Skip to content

unshare: new function HasCapSysAdmin #877

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

giuseppe
Copy link
Member

add a function to check whether the current process has the
CAP_SYS_ADMIN capability in its effective capabilities set.

Signed-off-by: Giuseppe Scrivano gscrivan@redhat.com

add a function to check whether the current process has the
CAP_SYS_ADMIN capability in its effective capabilities set.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@TomSweeneyRedHat
Copy link
Member

LGTM

1 similar comment
@rhatdan
Copy link
Member

rhatdan commented Apr 20, 2021

LGTM

@rhatdan rhatdan merged commit 8f31414 into containers:master Apr 20, 2021
@rhatdan
Copy link
Member

rhatdan commented Apr 28, 2021

This is broken in rootless mode.

 $ podman run -ti --security-opt label=disable -v /home/dwalsh:/home/dwalsh quay.io/rhatdan/podman sh
# /home/dwalsh/podman/bin/podman run alpine echo hello
cannot set user namespace
# cat /proc/self/uid_map 
         0       3267          1
         1     100000      65536

@rhatdan
Copy link
Member

rhatdan commented Apr 28, 2021

Rootfull fails also.

# podman run -ti --device=/dev/fuse --security-opt label=disable -v /home/dwalsh:/home/dwalsh quay.io/rhatdan/podman sh
# /home/dwalsh/podman/bin/podman run -v /proc:/proc alpine echo hello
cannot set user namespace

@rhatdan
Copy link
Member

rhatdan commented Apr 28, 2021

Never mind it works, I had lost the change of adding setns to seccomp.json.

@rhatdan
Copy link
Member

rhatdan commented Apr 28, 2021

In rootless mode, the podman image needs to have /etc/subuid and /etc/subgid with a root entry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants