Skip to content

Commit

Permalink
setup-user: use syscall instead of libcontainer/system
Browse files Browse the repository at this point in the history
Since Go 1.16, [Go issue 1435][1] is solved, and the stdlib syscall
implementations work on Linux.

  [1]: golang/go#1435

Signed-off-by: Bjorn Neergaard <[email protected]>
  • Loading branch information
neersighted authored and crazy-max committed Dec 16, 2023
1 parent 2b5d72f commit 9c8e4fc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions setup-user.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"os"
"syscall"

"github.com/opencontainers/runc/libcontainer/system"
"github.com/opencontainers/runc/libcontainer/user"
)

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9c8e4fc

Please sign in to comment.