Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add memory/file limits through prlimit and fix some issues #4

Merged
merged 10 commits into from
Jan 14, 2025

Conversation

funnyboy-roks
Copy link
Member

Fixes #2
Fixes #3

Also changes usage to be a bit nicer:

Command::new("bash")
    .restrict(rules)
    .max_memory(MemorySize::from_mb(50))
    .spawn()?

@funnyboy-roks
Copy link
Member Author

Also makes examples tests

@funnyboy-roks funnyboy-roks self-assigned this Jan 14, 2025
@funnyboy-roks funnyboy-roks merged commit dce3677 into main Jan 14, 2025
10 checks passed
@funnyboy-roks funnyboy-roks deleted the prlimit branch January 14, 2025 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use Arc for rules Add spawn_restricted_if
1 participant