diff options
author | gww <gww@eng.sun.com> | 2010-03-11 11:53:26 -0800 |
---|---|---|
committer | gww <gww@eng.sun.com> | 2010-03-11 11:53:26 -0800 |
commit | 047f6e6f42a3d50d3e38a05c00bf7dd3fafac726 (patch) | |
tree | fee27947a3df8160f2f34f1f18c80970af297713 /usr/src/lib/libbsm/common/adt_token.c | |
parent | 46c08a974e0e3e8aa24a730da1270e5b046bda29 (diff) | |
download | illumos-joyent-047f6e6f42a3d50d3e38a05c00bf7dd3fafac726.tar.gz |
6914628 Implement the user object audit token PSARC/2010/001 User object audit token
PSARC/2010/001 User object audit token
6580704 passwd gww produces a less optimal audit record.
Diffstat (limited to 'usr/src/lib/libbsm/common/adt_token.c')
-rw-r--r-- | usr/src/lib/libbsm/common/adt_token.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/usr/src/lib/libbsm/common/adt_token.c b/usr/src/lib/libbsm/common/adt_token.c index 79634de3de..cad7c905b6 100644 --- a/usr/src/lib/libbsm/common/adt_token.c +++ b/usr/src/lib/libbsm/common/adt_token.c @@ -844,6 +844,36 @@ adt_to_uauth(datadef *def, void *p_data, int required, } /* + * AUT_USER + */ + +/* ARGSUSED */ +static void +adt_to_user(datadef *def, void *p_data, int required, + struct adt_event_state *event, char *format) +{ + uid_t uid; + char *username; + + DPRINTF((" adt_to_user dd_datatype=%d\n", def->dd_datatype)); + + uid = ((union convert *)p_data)->tuid; + p_data = adt_adjust_address(p_data, sizeof (uid_t), sizeof (uid_t)); + + username = ((union convert *)p_data)->tcharstar; + + if (username == NULL) { + if (required) { + username = empty; + } else { + return; + } + } + DPRINTF((" username=%s\n", username)); + (void) au_write(event->ae_event_handle, au_to_user(uid, username)); +} + +/* * AUT_ZONENAME */ @@ -993,7 +1023,7 @@ adt_to_iport(datadef *def, void *p_data, int required, * adt_xlate.h), and the -AUT_PATH value. */ -#define MAX_TOKEN_JMP 20 +#define MAX_TOKEN_JMP 21 static struct token_jmp token_table[MAX_TOKEN_JMP] = { @@ -1016,6 +1046,7 @@ static struct token_jmp token_table[MAX_TOKEN_JMP] = {AUT_TEXT, adt_to_text}, {AUT_TID, adt_to_tid}, {AUT_UAUTH, adt_to_uauth}, + {AUT_USER, adt_to_user}, {AUT_ZONENAME, adt_to_zonename} }; |