Re: [PATCH v3 2/2] nsfs: Add an ioctl() to return owner UID of a userns

2017-01-24 Thread Eric W. Biederman
"Michael Kerrisk (man-pages)" writes: > I'd like to write code that discovers the user namespace hierarchy on > a running system, and also shows who owns the various user namespaces. > Currently, there is no way of getting the owner UID of a user > namespace. Therefore, this patch adds an NS_GET_

Re: [PATCH v3 2/2] nsfs: Add an ioctl() to return owner UID of a userns

2017-01-18 Thread Michael Kerrisk (man-pages)
On 17 January 2017 at 14:19, W. Trevor King wrote: > On Tue, Jan 17, 2017 at 02:03:29PM +1300, Michael Kerrisk (man-pages) wrote: >> + case NS_GET_OWNER_UID: >> + if (ns->ops->type != CLONE_NEWUSER) >> + return -EINVAL; >> + user_ns = container_of(ns

Re: [PATCH v3 2/2] nsfs: Add an ioctl() to return owner UID of a userns

2017-01-16 Thread W. Trevor King
On Tue, Jan 17, 2017 at 02:03:29PM +1300, Michael Kerrisk (man-pages) wrote: > + case NS_GET_OWNER_UID: > + if (ns->ops->type != CLONE_NEWUSER) > + return -EINVAL; > + user_ns = container_of(ns, struct user_namespace, ns); > + argp = (unsi

[PATCH v3 2/2] nsfs: Add an ioctl() to return owner UID of a userns

2017-01-16 Thread Michael Kerrisk (man-pages)
I'd like to write code that discovers the user namespace hierarchy on a running system, and also shows who owns the various user namespaces. Currently, there is no way of getting the owner UID of a user namespace. Therefore, this patch adds an NS_GET_CREATOR_UID ioctl() that fetches the (munged) UI