common version for new and old vm
authorKeith Sklower <sklower@ucbvax.Berkeley.EDU>
Fri, 28 Jun 1991 11:10:53 +0000 (03:10 -0800)
committerKeith Sklower <sklower@ucbvax.Berkeley.EDU>
Fri, 28 Jun 1991 11:10:53 +0000 (03:10 -0800)
SCCS-vsn: sys/netiso/esis.c 7.19
SCCS-vsn: sys/netiso/iso_pcb.c 7.10

usr/src/sys/netiso/esis.c
usr/src/sys/netiso/iso_pcb.c

index b294103..3c03e96 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)esis.c      7.18 (Berkeley) %G%
+ *     @(#)esis.c      7.19 (Berkeley) %G%
  */
 
 /***********************************************************
  */
 
 /***********************************************************
@@ -42,11 +42,9 @@ SOFTWARE.
 #include "mbuf.h"
 #include "domain.h"
 #include "protosw.h"
 #include "mbuf.h"
 #include "domain.h"
 #include "protosw.h"
-#include "user.h"
 #include "socket.h"
 #include "socketvar.h"
 #include "errno.h"
 #include "socket.h"
 #include "socketvar.h"
 #include "errno.h"
-#include "kernel.h"
 
 #include "../net/if.h"
 #include "../net/if_dl.h"
 
 #include "../net/if.h"
 #include "../net/if_dl.h"
@@ -62,6 +60,7 @@ SOFTWARE.
 #include "clnp_stat.h"
 #include "esis.h"
 #include "argo_debug.h"
 #include "clnp_stat.h"
 #include "esis.h"
 #include "argo_debug.h"
+#include "kernel.h"
 
 /*
  *     Global variables to esis implementation
 
 /*
  *     Global variables to esis implementation
@@ -73,6 +72,7 @@ SOFTWARE.
  *
  */
 struct rawcb   esis_pcb;
  *
  */
 struct rawcb   esis_pcb;
+int                            esis_config(), snpac_age();
 int                            esis_sendspace = 2048;
 int                            esis_recvspace = 2048;
 short                  esis_holding_time = ESIS_HT;
 int                            esis_sendspace = 2048;
 int                            esis_recvspace = 2048;
 short                  esis_holding_time = ESIS_HT;
@@ -106,7 +106,6 @@ esis_init()
 {
        extern struct clnl_protosw clnl_protox[256];
        int     esis_input(), isis_input();
 {
        extern struct clnl_protosw clnl_protox[256];
        int     esis_input(), isis_input();
-       int     esis_config(), snpac_age();
 #ifdef ISO_X25ESIS
        int     x25esis_input();
 #endif ISO_X25ESIS
 #ifdef ISO_X25ESIS
        int     x25esis_input();
 #endif ISO_X25ESIS
@@ -145,7 +144,7 @@ struct mbuf         *control;       /* optional control */
        struct rawcb *rp = sotorawcb(so);
        int error = 0;
 
        struct rawcb *rp = sotorawcb(so);
        int error = 0;
 
-       if (suser(u.u_cred, &u.u_acflag)) {
+       if ((so->so_state & SS_PRIV) == 0) {
                error = EACCES;
                goto release;
        }
                error = EACCES;
                goto release;
        }
index f088a97..037a5ee 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)iso_pcb.c   7.9 (Berkeley) %G%
+ *     @(#)iso_pcb.c   7.10 (Berkeley) %G%
  */
 
 /***********************************************************
  */
 
 /***********************************************************
@@ -44,10 +44,11 @@ SOFTWARE.
 
 #include "param.h"
 #include "systm.h"
 
 #include "param.h"
 #include "systm.h"
-#include "user.h"
 #include "mbuf.h"
 #include "socket.h"
 #include "socketvar.h"
 #include "mbuf.h"
 #include "socket.h"
 #include "socketvar.h"
+#include "errno.h"
+
 #include "argo_debug.h"
 #include "iso.h"
 #include "clnp.h"
 #include "argo_debug.h"
 #include "iso.h"
 #include "clnp.h"
@@ -193,7 +194,7 @@ iso_pcbbind(isop, nam)
        bcopy((caddr_t)siso, (caddr_t)isop->isop_laddr, siso->siso_len);
        if (suf.s || siso->siso_tlen != 2) {
                if((suf.s < ISO_PORT_RESERVED) && (siso->siso_tlen <= 2) &&
        bcopy((caddr_t)siso, (caddr_t)isop->isop_laddr, siso->siso_len);
        if (suf.s || siso->siso_tlen != 2) {
                if((suf.s < ISO_PORT_RESERVED) && (siso->siso_tlen <= 2) &&
-                  (u.u_uid != 0))
+                  (isop->isop_socket->so_state && SS_PRIV) == 0)
                        return EACCES;
                if ((isop->isop_socket->so_options & SO_REUSEADDR) == 0 &&
                        iso_pcblookup(head, 0, (caddr_t)0, isop->isop_laddr))
                        return EACCES;
                if ((isop->isop_socket->so_options & SO_REUSEADDR) == 0 &&
                        iso_pcblookup(head, 0, (caddr_t)0, isop->isop_laddr))