From 0136bbfac51af0fd27a39749bd16d5c5c31c21b4 Mon Sep 17 00:00:00 2001 From: Fedor Korotkiy Date: Thu, 13 Feb 2020 02:56:04 +0300 Subject: [PATCH] Debugging --- tools/testtool/commands/sandbox.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tools/testtool/commands/sandbox.go b/tools/testtool/commands/sandbox.go index a5978df..3fa640b 100644 --- a/tools/testtool/commands/sandbox.go +++ b/tools/testtool/commands/sandbox.go @@ -1,7 +1,7 @@ package commands import ( - "log" + "os" "os/exec" "os/user" "strconv" @@ -9,12 +9,7 @@ import ( ) func currentUserIsRoot() bool { - me, err := user.Current() - if err != nil { - log.Fatal(err) - } - - return me.Uid == "0" + return os.Getuid() == 0 } func sandbox(cmd *exec.Cmd) error {