Skip to content

Commit

Permalink
libcontainer: drop system.Setxid
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. While they are a bit more
flexible/heavier-weight than the implementations that were copied to
libcontainer/system (working across all threads), we compile with Cgo,
and using the libc wrappers should be just as suitable.

  [1]: golang/go#1435

Signed-off-by: Bjorn Neergaard <[email protected]>
  • Loading branch information
neersighted committed Oct 11, 2023
1 parent 520a3d5 commit 6f7266c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 56 deletions.
4 changes: 2 additions & 2 deletions libcontainer/init_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -525,10 +525,10 @@ func setupUser(config *initConfig) error {
}
}

if err := system.Setgid(execUser.Gid); err != nil {
if err := unix.Setgid(execUser.Gid); err != nil {
return err
}
if err := system.Setuid(execUser.Uid); err != nil {
if err := unix.Setuid(execUser.Uid); err != nil {
return err
}

Expand Down
27 changes: 0 additions & 27 deletions libcontainer/system/syscall_linux_32.go

This file was deleted.

27 changes: 0 additions & 27 deletions libcontainer/system/syscall_linux_64.go

This file was deleted.

0 comments on commit 6f7266c

Please sign in to comment.