diff options
Diffstat (limited to 'kernel/auditsc.c')
-rw-r--r-- | kernel/auditsc.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 66148f81d783..37b3ac94bc47 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c | |||
@@ -1010,20 +1010,21 @@ void audit_get_stamp(struct audit_context *ctx, | |||
1010 | 1010 | ||
1011 | extern int audit_set_type(struct audit_buffer *ab, int type); | 1011 | extern int audit_set_type(struct audit_buffer *ab, int type); |
1012 | 1012 | ||
1013 | int audit_set_loginuid(struct audit_context *ctx, uid_t loginuid) | 1013 | int audit_set_loginuid(struct task_struct *task, uid_t loginuid) |
1014 | { | 1014 | { |
1015 | if (ctx) { | 1015 | if (task->audit_context) { |
1016 | struct audit_buffer *ab; | 1016 | struct audit_buffer *ab; |
1017 | 1017 | ||
1018 | ab = audit_log_start(NULL); | 1018 | ab = audit_log_start(NULL); |
1019 | if (ab) { | 1019 | if (ab) { |
1020 | audit_log_format(ab, "login pid=%d uid=%u " | 1020 | audit_log_format(ab, "login pid=%d uid=%u " |
1021 | "old loginuid=%u new loginuid=%u", | 1021 | "old loginuid=%u new loginuid=%u", |
1022 | ctx->pid, ctx->uid, ctx->loginuid, loginuid); | 1022 | task->pid, task->uid, |
1023 | task->audit_context->loginuid, loginuid); | ||
1023 | audit_set_type(ab, AUDIT_LOGIN); | 1024 | audit_set_type(ab, AUDIT_LOGIN); |
1024 | audit_log_end(ab); | 1025 | audit_log_end(ab); |
1025 | } | 1026 | } |
1026 | ctx->loginuid = loginuid; | 1027 | task->audit_context->loginuid = loginuid; |
1027 | } | 1028 | } |
1028 | return 0; | 1029 | return 0; |
1029 | } | 1030 | } |