1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-03 09:00:21 +00:00

Make sure that the termid type is initialized to AU_IPv4 by default.

This makes sure that process tokens credentials with un-initialized
audit contexts are handled correctly.  Currently, when invariants are
enabled, this change fixes a panic by ensuring that we have a valid
termid family.  Also, this fixes token generation for process tokens
making sure that userspace is always getting a valid token.

This is consistent with what Solaris does when an audit context is
un-initialized.

Obtained from:	TrustedBSD Project
MFC after:	1 week
This commit is contained in:
Christian S.J. Peron 2008-01-28 17:33:46 +00:00
parent 0aeee4bd8a
commit c52a508838
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=175763

View File

@ -551,6 +551,7 @@ audit_cred_kproc0(struct ucred *cred)
{
cred->cr_audit.ai_auid = AU_DEFAUDITID;
cred->cr_audit.ai_termid.at_type = AU_IPv4;
}
void
@ -558,6 +559,7 @@ audit_cred_proc1(struct ucred *cred)
{
cred->cr_audit.ai_auid = AU_DEFAUDITID;
cred->cr_audit.ai_termid.at_type = AU_IPv4;
}
void