MFC: sys/netinet6/ipsec.c 1.45

- Use suser_cred(9) instead of directly comparing cr_uid.
- Compare pointer with NULL, instead of 0.

Reviewed by:	rwatson
This commit is contained in:
pjd 2006-09-04 10:35:07 +00:00
parent 1a5273828f
commit 6c37569be2

View File

@ -1222,7 +1222,8 @@ ipsec_init_pcbpolicy(so, pcb_sp)
}
bzero(new, sizeof(*new));
if (so->so_cred != 0 && so->so_cred->cr_uid == 0)
if (so->so_cred != NULL &&
suser_cred(so->so_cred, SUSER_ALLOWJAIL) == 0)
new->priv = 1;
else
new->priv = 0;