summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--test/test-manager/src/container.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/test-manager/src/container.rs b/test/test-manager/src/container.rs
index 9560f48b3e..a4ab6725d9 100644
--- a/test/test-manager/src/container.rs
+++ b/test/test-manager/src/container.rs
@@ -1,12 +1,14 @@
#![cfg(target_os = "linux")]
+use nix::unistd::geteuid;
use tokio::process::Command;
/// Re-launch self with rootlesskit if we're not root.
/// Allows for rootless and containerized networking.
/// The VNC port is published to localhost.
pub async fn relaunch_with_rootlesskit(vnc_port: Option<u16>) {
- if unsafe { libc::geteuid() } == 0 {
+ // check if user is root (`man getuid`).
+ if geteuid().is_root() {
return;
}