-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
refactor: use execvp directly instead of process::Command #9013
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
base: main
Are you sure you want to change the base?
Conversation
- Replace process::Command execution with direct execvp call via libc for improved performance by avoiding process forking - Add validation to detect and error on commands containing null bytes - Capture and handle execution errors using the last OS error after execvp failure
|
Rather than using
|
CodSpeed Performance ReportMerging #9013 will not alter performanceComparing Summary
Footnotes
|
|
GNU testsuite comparison: |
… execution Simplified the command execution by using Rust's standard ProcessCommand instead of direct libc calls, improving code readability and reducing manual memory management.
I made some revisions based on your feedback. |
|
GNU testsuite comparison: |
|
I confirm this change fixes #9010 Nice job! :) |
|
would it be possible to add a test? thanks |
Added three new tests to verify chroot behavior: - Test for command not found, expecting exit code 127 and "No such file or directory" error. - Test for permission denied, expecting exit code 126 and "Permission denied" error. - Test to confirm UID and GID are retained as root (0) inside the chroot. These tests enhance coverage for edge cases and ensure robust error reporting, requiring root privileges to run.
Added 'noexec' to the jargon wordlist to recognize this technical term and avoid false positives during spell checking in the project.
|
GNU testsuite comparison: |
Done |
fix this issue
#9010