diff options
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/lib/libbsm/common/adt.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/usr/src/lib/libbsm/common/adt.c b/usr/src/lib/libbsm/common/adt.c index d18db245aa..14b5d9315d 100644 --- a/usr/src/lib/libbsm/common/adt.c +++ b/usr/src/lib/libbsm/common/adt.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -1482,6 +1482,18 @@ adt_newuser(adt_internal_state_t *state, uid_t ruid, au_tid_addr_t *termid) if (adt_get_mask_from_user(ruid, &(state->as_info.ai_mask))) return (-1); + /* Assume intending to audit as this process */ + + if (state->as_pid == (pid_t)-1) + state->as_pid = getpid(); + + if (is_system_labeled() && state->as_label == NULL) { + ucred_t *ucred = ucred_get(P_MYID); + + state->as_label = adt_ucred_label(ucred); + ucred_free(ucred); + } + return (0); } |