lkml.org 
[lkml]   [2010]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[RFC 3/5] user namespaces: allow sethostname in a container
    Signed-off-by: Serge E. Hallyn <serge.hallyn@canonical.com>
    ---
    kernel/sys.c | 2 +-
    1 files changed, 1 insertions(+), 1 deletions(-)

    diff --git a/kernel/sys.c b/kernel/sys.c
    index 2745dcd..9b9b03b 100644
    --- a/kernel/sys.c
    +++ b/kernel/sys.c
    @@ -1171,7 +1171,7 @@ SYSCALL_DEFINE2(sethostname, char __user *, name, int, len)
    int errno;
    char tmp[__NEW_UTS_LEN];

    - if (!capable(CAP_SYS_ADMIN))
    + if (!ns_capable(current->nsproxy->uts_ns->user_ns, CAP_SYS_ADMIN))
    return -EPERM;
    if (len < 0 || len > __NEW_UTS_LEN)
    return -EINVAL;
    --
    1.7.0.4


    \
     
     \ /
      Last update: 2010-12-17 16:29    [W:0.019 / U:90.888 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site