Merge branch 'misc' of master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc...
[pandora-kernel.git] / net / core / wireless.c
index 81d6995..d2bc72d 100644 (file)
@@ -1726,6 +1726,14 @@ int wireless_rtnetlink_get(struct net_device *   dev,
        if(!IW_IS_GET(request->cmd))
                return -EOPNOTSUPP;
 
+       /* If command is `get the encoding parameters', check if
+        * the user has the right to do it */
+       if (request->cmd == SIOCGIWENCODE ||
+           request->cmd == SIOCGIWENCODEEXT) {
+               if (!capable(CAP_NET_ADMIN))
+                       return -EPERM;
+       }
+
        /* Special cases */
        if(request->cmd == SIOCGIWSTATS)
                /* Get Wireless Stats */