Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1562384

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

From "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 2/2] nsfs: Add an ioctl() to return owner UID of a userns
Date 2017-01-19 03:30 +0100
Message-ID <t1aE9-3NW-3@gated-at.bofh.it> (permalink)
References <t0qrE-f1-9@gated-at.bofh.it> <t0qrE-f1-7@gated-at.bofh.it> <t0qKZ-m4-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 17 January 2017 at 14:19, W. Trevor King <wking@tremily.us> 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, struct user_namespace, ns);
>> +             argp = (unsigned int __user *) arg;
>> +             uid = from_kuid_munged(current_user_ns(), user_ns->owner);
>> +             return put_user(uid, argp);
>> …
>> +/* Get owner UID for a user namespace */
>> +#define NS_GET_OWNER_UID     _IO(NSIO, 0x4)
>
> The comment here should probably be:
>
>   Get owner UID (in the current user namespace) for a user namespace
>
> or some such, to convey that current_user_ns is being passed to
> from_kuid_munged.

Thanks, Trevor. I'll fix that. From a user-space perspective though
"in the current user namespace" should be "in the caller's user
namespace".

Cheers,

Michael

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 2/2] nsfs: Add an ioctl() to return owner UID of a userns "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> - 2017-01-17 02:10 +0100
  Re: [PATCH v3 2/2] nsfs: Add an ioctl() to return owner UID of a  userns "W. Trevor King" <wking@tremily.us> - 2017-01-17 02:30 +0100
    Re: [PATCH v3 2/2] nsfs: Add an ioctl() to return owner UID of a userns "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> - 2017-01-19 03:30 +0100
  Re: [PATCH v3 2/2] nsfs: Add an ioctl() to return owner UID of a userns ebiederm@xmission.com (Eric W. Biederman) - 2017-01-24 23:40 +0100

csiph-web