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

Prevent sccache-dist from running as root #1680

Closed
wants to merge 1 commit into from

Conversation

sylvestre
Copy link
Collaborator

No description provided.

@sylvestre sylvestre requested review from drahnr, glandium and Xuanwo March 22, 2023 13:24
@codecov-commenter
Copy link

codecov-commenter commented Mar 22, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 30.94%. Comparing base (458b0af) to head (c0cec46).
Report is 137 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

@sylvestre
Copy link
Collaborator Author

I will fix the test

let euid: uid_t = unsafe { geteuid() };

if euid == 0 {
println!("This program should not be executed as root.");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
println!("This program should not be executed as root.");
eprintln!("This program should not be executed as root.");

Comment on lines +47 to +32
#[cfg(any(
all(target_os = "linux", target_arch = "x86_64"),
target_os = "freebsd"
))]
use libc::{geteuid, uid_t};
Copy link
Collaborator

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.

@drahnr
Copy link
Collaborator

drahnr commented Feb 5, 2025

@sylvestre a particular reason this was closed?

@sylvestre
Copy link
Collaborator Author

Yeah, I won't have time to work on it :)

@drahnr drahnr self-assigned this Feb 5, 2025
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.

4 participants