[PATCH] af_decnet.c: s/suser/capable/, micro cleanup

From: Arnaldo Carvalho de Melo (acme@conectiva.com.br)
Date: Sun Aug 27 2000 - 09:44:03 EST


Hi,

        Please consider applying.

                        - Arnaldo

--- linux-2.4.0-test7/net/decnet/af_decnet.c Thu Jun 22 11:23:26 2000
+++ linux-2.4.0-test7.acme/net/decnet/af_decnet.c Sun Aug 27 11:42:03 2000
@@ -32,6 +32,7 @@
  * Patrick Caulfield: Fixes to delayed acceptance logic.
  * David S. Miller: New socket locking
  * Steve Whitehouse: Socket list hashing/locking
+ * Arnaldo C. Melo: use capable, not suser
  */
 
 
@@ -688,7 +689,7 @@
         if (dn_ntohs(saddr->sdn_nodeaddrl) && (dn_ntohs(saddr->sdn_nodeaddrl) != 2))
                 return -EINVAL;
 
- if (saddr->sdn_objnum && !suser())
+ if (saddr->sdn_objnum && !capable(CAP_NET_BIND_SERVICE))
                 return -EPERM;
 
         if (dn_ntohs(saddr->sdn_objnamel) > DN_MAXOBJL)
@@ -698,7 +699,7 @@
                 return -EINVAL;
 
         if (saddr->sdn_flags & SDF_WILD) {
- if (!suser())
+ if (!capable(CAP_NET_BIND_SERVICE))
                         return -EPERM;
         } else {
                 if (dn_ntohs(saddr->sdn_nodeaddrl)) {
@@ -1101,7 +1102,7 @@
 
 #if 0
         case SIOCSIFADDR:
- if (!suser()) return -EPERM;
+ if (!capable(CAP_NET_ADMIN)) return -EPERM;
 
                 if ((err = copy_from_user(devname, ioarg->devname, 5)) != 0)
                         break;
@@ -1143,7 +1144,7 @@
 
 #if 0
         case SIOCSNETADDR:
- if (!suser()) {
+ if (!capable(CAP_NET_ADMIN)) {
                         err = -EPERM;
                         break;
                 }
@@ -1174,7 +1175,7 @@
                 break;
 #endif
         case OSIOCSNETADDR:
- if (!suser()) {
+ if (!capable(CAP_NET_ADMIN)) {
                         err = -EPERM;
                         break;
                 }
@@ -1189,8 +1190,7 @@
                 break;
 
         case OSIOCGNETADDR:
- if ((err = put_user(decnet_address, (unsigned short *)arg)) != 0)
- break;
+ err = put_user(decnet_address, (unsigned short *)arg);
                 break;
         case SIOCGIFCONF:
         case SIOCGIFFLAGS:
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Aug 31 2000 - 21:00:19 EST