net: change return values from -EACCES to -EPERM
Change return value from -EACCES to -EPERM when the permission check fails. Signed-off-by: Zhao Hongjiang <zhaohongjiang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
e0c7a4a1a6
commit
bf5b30b8a4
@@ -725,7 +725,7 @@ int devinet_ioctl(struct net *net, unsigned int cmd, void __user *arg)
|
||||
break;
|
||||
|
||||
case SIOCSIFFLAGS:
|
||||
ret = -EACCES;
|
||||
ret = -EPERM;
|
||||
if (!capable(CAP_NET_ADMIN))
|
||||
goto out;
|
||||
break;
|
||||
@@ -733,7 +733,7 @@ int devinet_ioctl(struct net *net, unsigned int cmd, void __user *arg)
|
||||
case SIOCSIFBRDADDR: /* Set the broadcast address */
|
||||
case SIOCSIFDSTADDR: /* Set the destination address */
|
||||
case SIOCSIFNETMASK: /* Set the netmask for the interface */
|
||||
ret = -EACCES;
|
||||
ret = -EPERM;
|
||||
if (!capable(CAP_NET_ADMIN))
|
||||
goto out;
|
||||
ret = -EINVAL;
|
||||
|
Reference in New Issue
Block a user