Skip to content

Commit

Permalink
ppp: allow usage in namespaces
Browse files Browse the repository at this point in the history
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: Matteo Croce <mcroce@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Matteo Croce authored and David S. Miller committed Oct 29, 2017
1 parent 87e3de1 commit 90e229e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ppp/ppp_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
if (!capable(CAP_NET_ADMIN))
if (!ns_capable(file->f_cred->user_ns, CAP_NET_ADMIN))
return -EPERM;
return 0;
}
Expand Down

0 comments on commit 90e229e

Please sign in to comment.