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;
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);
* 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);
}