[BONDING]: Remove CAP_NET_ADMIN requirement for INFOQUERY ioctl
authorThomas Graf <tgraf@suug.ch>
Tue, 24 Jan 2006 20:46:33 +0000 (12:46 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Jan 2006 20:46:33 +0000 (12:46 -0800)
This information is already available via /proc/net/bonding/*
therefore it doesn't make sense to require CAP_NET_ADMIN
privileges.

Original patch by Laurent Deniel <laurent.deniel@free.fr>

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c

index fd070a098f20656027dca9c38a3b7a43a0ad1082..ffb82073056e761267dcbd480603d01645cfd7cf 100644 (file)
@@ -2543,13 +2543,14 @@ int dev_ioctl(unsigned int cmd, void __user *arg)
                case SIOCBONDENSLAVE:
                case SIOCBONDRELEASE:
                case SIOCBONDSETHWADDR:
-               case SIOCBONDSLAVEINFOQUERY:
-               case SIOCBONDINFOQUERY:
                case SIOCBONDCHANGEACTIVE:
                case SIOCBRADDIF:
                case SIOCBRDELIF:
                        if (!capable(CAP_NET_ADMIN))
                                return -EPERM;
+                       /* fall through */
+               case SIOCBONDSLAVEINFOQUERY:
+               case SIOCBONDINFOQUERY:
                        dev_load(ifr.ifr_name);
                        rtnl_lock();
                        ret = dev_ifsioc(&ifr, cmd);