can't let users take interfaces up and down
authorJim Bloom <bloom@ucbvax.Berkeley.EDU>
Sat, 7 Dec 1985 02:39:29 +0000 (18:39 -0800)
committerJim Bloom <bloom@ucbvax.Berkeley.EDU>
Sat, 7 Dec 1985 02:39:29 +0000 (18:39 -0800)
SCCS-vsn: sys/net/if.c 6.10

usr/src/sys/net/if.c

index f7da8d4..c9026c4 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)if.c        6.9 (Berkeley) %G%
+ *     @(#)if.c        6.10 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -257,6 +257,8 @@ ifioctl(so, cmd, data)
                break;
 
        case SIOCSIFFLAGS:
                break;
 
        case SIOCSIFFLAGS:
+               if (!suser())
+                       return (u.u_error);
                if (ifp->if_flags & IFF_UP && (ifr->ifr_flags & IFF_UP) == 0) {
                        int s = splimp();
                        if_down(ifp);
                if (ifp->if_flags & IFF_UP && (ifr->ifr_flags & IFF_UP) == 0) {
                        int s = splimp();
                        if_down(ifp);