From 512d5e6bdc29cbee291f542f05e2354fc695becf Mon Sep 17 00:00:00 2001 From: Bjorn Neergaard Date: Wed, 11 Oct 2023 10:32:40 -0600 Subject: [PATCH] setup-user: use syscall instead of libcontainer/system Since Go 1.16, [Go issue 1435][1] is solved, and the stdlib syscall implementations work on Linux. [1]: https://github.com/golang/go/issues/1435 Signed-off-by: Bjorn Neergaard --- setup-user.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/setup-user.go b/setup-user.go index 3a04ec9..57b5343 100644 --- a/setup-user.go +++ b/setup-user.go @@ -4,7 +4,6 @@ import ( "os" "syscall" - "github.com/opencontainers/runc/libcontainer/system" "github.com/opencontainers/runc/libcontainer/user" ) @@ -35,10 +34,10 @@ func SetupUser(u string) error { if err := syscall.Setgroups(execUser.Sgids); err != nil { return err } - if err := system.Setgid(execUser.Gid); err != nil { + if err := syscall.Setgid(execUser.Gid); err != nil { return err } - if err := system.Setuid(execUser.Uid); err != nil { + if err := syscall.Setuid(execUser.Uid); err != nil { return err } // if we didn't get HOME already, set it based on the user's HOME