Commit 90e229ef authored by Matteo Croce's avatar Matteo Croce Committed by David S. Miller

ppp: allow usage in namespaces

Check for CAP_NET_ADMIN with ns_capable() instead of capable()
to allow usage of ppp in user namespace other than the init one.
Signed-off-by: default avatarMatteo Croce <mcroce@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 87e3de1e
...@@ -390,7 +390,7 @@ static int ppp_open(struct inode *inode, struct file *file) ...@@ -390,7 +390,7 @@ static int ppp_open(struct inode *inode, struct file *file)
/* /*
* This could (should?) be enforced by the permissions on /dev/ppp. * This could (should?) be enforced by the permissions on /dev/ppp.
*/ */
if (!capable(CAP_NET_ADMIN)) if (!ns_capable(file->f_cred->user_ns, CAP_NET_ADMIN))
return -EPERM; return -EPERM;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment