-
Notifications
You must be signed in to change notification settings - Fork 561
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
Prevent sccache-dist from running as root #1680
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1680 +/- ##
==========================================
- Coverage 30.98% 30.94% -0.05%
==========================================
Files 53 53
Lines 20014 20014
Branches 9700 9700
==========================================
- Hits 6202 6193 -9
- Misses 7920 7922 +2
- Partials 5892 5899 +7 ☔ View full report in Codecov by Sentry. |
I will fix the test |
let euid: uid_t = unsafe { geteuid() }; | ||
|
||
if euid == 0 { | ||
println!("This program should not be executed as root."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
println!("This program should not be executed as root."); | |
eprintln!("This program should not be executed as root."); |
#[cfg(any( | ||
all(target_os = "linux", target_arch = "x86_64"), | ||
target_os = "freebsd" | ||
))] | ||
use libc::{geteuid, uid_t}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I'd import it within the function, or use it's full path since it's the only place it's actually used.
@sylvestre a particular reason this was closed? |
Yeah, I won't have time to work on it :) |
No description provided.