Merge branches 'master' and 'suser_to_priv'
authorMichael Neumann <mneumann@ntecs.de>
Wed, 31 Dec 2008 13:06:40 +0000 (13:06 +0000)
committerMichael Neumann <mneumann@ntecs.de>
Wed, 31 Dec 2008 13:06:40 +0000 (13:06 +0000)
Conflicts:

sys/netinet/ip_carp.c
sys/platform/pc64/amd64/machdep.c

18 files changed:
1  2 
sys/dev/misc/syscons/syscons.c
sys/dev/netif/cx/cx.c
sys/dev/netif/wi/if_wi.c
sys/dev/netif/wl/if_wl.c
sys/kern/vfs_syscalls.c
sys/kern/vfs_vnops.c
sys/net/bridge/if_bridge.c
sys/netinet/in.c
sys/netinet/ip_carp.c
sys/netinet/ip_output.c
sys/netinet/tcp_subr.c
sys/netinet6/in6.c
sys/netinet6/in6_src.c
sys/netinet6/ip6_input.c
sys/netproto/ipx/ipx_usrreq.c
sys/platform/pc64/amd64/machdep.c
sys/vfs/hammer/hammer.h
sys/vm/vm_swap.c

Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -1798,16 -1730,13 +1799,16 @@@ carp_ioctl(struct ifnet *ifp, u_long cm
                break;
  
        case SIOCSVH:
-               error = suser_cred(cr, NULL_CRED_OKAY);
+               error = priv_check_cred(cr, PRIV_ROOT, NULL_CRED_OKAY);
                if (error)
                        break;
 -              if ((error = copyin(ifr->ifr_data, &carpr, sizeof carpr)))
 +              error = copyin(ifr->ifr_data, &carpr, sizeof(carpr));
 +              if (error)
                        break;
 +
                error = 1;
 -              if (sc->sc_state != INIT && carpr.carpr_state != sc->sc_state) {
 +              if ((ifp->if_flags & IFF_RUNNING) &&
 +                  sc->sc_state != INIT && carpr.carpr_state != sc->sc_state) {
                        switch (carpr.carpr_state) {
                        case BACKUP:
                                callout_stop(&sc->sc_ad_tmo);
                carpr.carpr_vhid = sc->sc_vhid;
                carpr.carpr_advbase = sc->sc_advbase;
                carpr.carpr_advskew = sc->sc_advskew;
-               error = suser_cred(cr, NULL_CRED_OKAY);
+               error = priv_check_cred(cr, PRIV_ROOT, NULL_CRED_OKAY);
                if (error == 0) {
                        bcopy(sc->sc_key, carpr.carpr_key,
 -                          sizeof(carpr.carpr_key));
 +                            sizeof(carpr.carpr_key));
                }
 +
                error = copyout(&carpr, ifr->ifr_data, sizeof(carpr));
                break;
  
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -595,9 -596,9 +596,9 @@@ static in
  ripx_attach(struct socket *so, int proto, struct pru_attach_info *ai)
  {
        int error = 0;
 -      struct ipxpcb *ipxp = sotoipxpcb(so);
 +      struct ipxpcb *ipxp;
  
-       if ((error = suser_cred(ai->p_ucred, NULL_CRED_OKAY)) != 0)
+       if ((error = priv_check_cred(ai->p_ucred, PRIV_ROOT, NULL_CRED_OKAY)) != 0)
                return (error);
        crit_enter();
        error = ipx_pcballoc(so, &ipxrawpcb);
@@@ -2240,10 -2239,11 +2241,10 @@@ set_dbregs(struct lwp *lp, struct dbre
                 * from within kernel mode?
                 */
  
-               if (suser_cred(ucred, 0) != 0) {
+               if (priv_check_cred(ucred, PRIV_ROOT, 0) != 0) {
 -#if JG
 -                      if (dbregs->dr7 & 0x3) {
 +                      if (dbregs->dr[7] & 0x3) {
                                /* dr0 is enabled */
 -                              if (dbregs->dr0 >= VM_MAX_USER_ADDRESS)
 +                              if (dbregs->dr[0] >= VM_MAX_USER_ADDRESS)
                                        return (EINVAL);
                        }
  
Simple merge
Simple merge