.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2004 IBM Corporation |
---|
3 | 4 | * |
---|
4 | 5 | * Author: Serge Hallyn <serue@us.ibm.com> |
---|
5 | | - * |
---|
6 | | - * This program is free software; you can redistribute it and/or |
---|
7 | | - * modify it under the terms of the GNU General Public License as |
---|
8 | | - * published by the Free Software Foundation, version 2 of the |
---|
9 | | - * License. |
---|
10 | 6 | */ |
---|
11 | 7 | |
---|
12 | 8 | #include <linux/export.h> |
---|
.. | .. |
---|
144 | 140 | put_uts_ns(to_uts_ns(ns)); |
---|
145 | 141 | } |
---|
146 | 142 | |
---|
147 | | -static int utsns_install(struct nsproxy *nsproxy, struct ns_common *new) |
---|
| 143 | +static int utsns_install(struct nsset *nsset, struct ns_common *new) |
---|
148 | 144 | { |
---|
| 145 | + struct nsproxy *nsproxy = nsset->nsproxy; |
---|
149 | 146 | struct uts_namespace *ns = to_uts_ns(new); |
---|
150 | 147 | |
---|
151 | 148 | if (!ns_capable(ns->user_ns, CAP_SYS_ADMIN) || |
---|
152 | | - !ns_capable(current_user_ns(), CAP_SYS_ADMIN)) |
---|
| 149 | + !ns_capable(nsset->cred->user_ns, CAP_SYS_ADMIN)) |
---|
153 | 150 | return -EPERM; |
---|
154 | 151 | |
---|
155 | 152 | get_uts_ns(ns); |
---|