MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / is_root_user

Function is_root_user

src/executor/helpers/run_with_sudo.rs:9–14  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7};
8
9pub fn is_root_user() -> bool {
10 #[cfg(unix)]
11 return nix::unistd::Uid::current().is_root();
12 #[cfg(not(unix))]
13 return false;
14}
15
16fn is_sudo_available() -> bool {
17 Command::new("sudo")

Callers 5

ensure_privilegesMethod · 0.85
privilege_statusMethod · 0.85
wrap_with_sudoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected