Skip to content

Commit

Permalink
Merge pull request containers#20769 from giuseppe/fix-crash-podman-info
Browse files Browse the repository at this point in the history
system: enhance check for re-exec into rootless userns
  • Loading branch information
openshift-merge-bot[bot] authored Nov 27, 2023
2 parents ac23b02 + 41a6b99 commit 208ad3b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/domain/infra/abi/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ func (ic *ContainerEngine) SetupRootless(_ context.Context, noMoveProcess bool)
if err != nil {
return err
}
if hasCapSysAdmin {
// check for both euid == 0 and CAP_SYS_ADMIN because we may be running in a container with CAP_SYS_ADMIN set.
if os.Geteuid() == 0 && hasCapSysAdmin {
ownsCgroup, err := cgroups.UserOwnsCurrentSystemdCgroup()
if err != nil {
logrus.Infof("Failed to detect the owner for the current cgroup: %v", err)
Expand Down

0 comments on commit 208ad3b

Please sign in to comment.