diff --git a/fakeroot.go b/fakeroot.go index 37a755a..4c1f9e0 100644 --- a/fakeroot.go +++ b/fakeroot.go @@ -27,6 +27,7 @@ func Command(name string, arg ...string) (*exec.Cmd, error) { // registered in the command. func Apply(cmd *exec.Cmd) error { uid := os.Getuid() + gid := os.Getgid() // If the user is already root, there's no need for fakeroot if uid == 0 { @@ -59,7 +60,7 @@ func Apply(cmd *exec.Cmd) error { cmd.SysProcAttr.GidMappings = append(cmd.SysProcAttr.GidMappings, syscall.SysProcIDMap{ ContainerID: 0, - HostID: uid, + HostID: gid, Size: 1, })