mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-22 15:47:37 +00:00
- 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:
parent
835d4b8924
commit
5279398812
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=159977
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user