Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
}