Use suser_cred()
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 3 Dec 2008 11:48:01 +0000 (19:48 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 3 Dec 2008 13:22:58 +0000 (21:22 +0800)
sys/netinet/ip_carp.c

index b2be282..a29bb1b 100644 (file)
@@ -1778,7 +1778,7 @@ carp_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr, struct ucred *cr)
                break;
 
        case SIOCSVH:
-               error = suser(curthread);
+               error = suser_cred(cr, NULL_CRED_OKAY);
                if (error)
                        break;
                if ((error = copyin(ifr->ifr_data, &carpr, sizeof carpr)))
@@ -1852,7 +1852,7 @@ carp_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr, struct ucred *cr)
                carpr.carpr_vhid = sc->sc_vhid;
                carpr.carpr_advbase = sc->sc_advbase;
                carpr.carpr_advskew = sc->sc_advskew;
-               error = suser(curthread);
+               error = suser_cred(cr, NULL_CRED_OKAY);
                if (error == 0) {
                        bcopy(sc->sc_key, carpr.carpr_key,
                            sizeof(carpr.carpr_key));