diff options
Diffstat (limited to 'kernel/auditsc.c')
-rw-r--r-- | kernel/auditsc.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 94338abf76f5..d089263253a7 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c | |||
@@ -648,7 +648,7 @@ static void audit_log_exit(struct audit_context *context) | |||
648 | int i; | 648 | int i; |
649 | struct audit_buffer *ab; | 649 | struct audit_buffer *ab; |
650 | 650 | ||
651 | ab = audit_log_start(context); | 651 | ab = audit_log_start(context, AUDIT_KERNEL, 0); |
652 | if (!ab) | 652 | if (!ab) |
653 | return; /* audit_panic has been called */ | 653 | return; /* audit_panic has been called */ |
654 | audit_log_format(ab, "syscall=%d", context->major); | 654 | audit_log_format(ab, "syscall=%d", context->major); |
@@ -680,7 +680,7 @@ static void audit_log_exit(struct audit_context *context) | |||
680 | while (context->aux) { | 680 | while (context->aux) { |
681 | struct audit_aux_data *aux; | 681 | struct audit_aux_data *aux; |
682 | 682 | ||
683 | ab = audit_log_start(context); | 683 | ab = audit_log_start(context, AUDIT_KERNEL, 0); |
684 | if (!ab) | 684 | if (!ab) |
685 | continue; /* audit_panic has been called */ | 685 | continue; /* audit_panic has been called */ |
686 | 686 | ||
@@ -701,7 +701,7 @@ static void audit_log_exit(struct audit_context *context) | |||
701 | } | 701 | } |
702 | 702 | ||
703 | for (i = 0; i < context->name_count; i++) { | 703 | for (i = 0; i < context->name_count; i++) { |
704 | ab = audit_log_start(context); | 704 | ab = audit_log_start(context, AUDIT_KERNEL, 0); |
705 | if (!ab) | 705 | if (!ab) |
706 | continue; /* audit_panic has been called */ | 706 | continue; /* audit_panic has been called */ |
707 | audit_log_format(ab, "item=%d", i); | 707 | audit_log_format(ab, "item=%d", i); |
@@ -1005,22 +1005,13 @@ int audit_get_stamp(struct audit_context *ctx, | |||
1005 | return 0; | 1005 | return 0; |
1006 | } | 1006 | } |
1007 | 1007 | ||
1008 | extern int audit_set_type(struct audit_buffer *ab, int type); | ||
1009 | |||
1010 | int audit_set_loginuid(struct task_struct *task, uid_t loginuid) | 1008 | int audit_set_loginuid(struct task_struct *task, uid_t loginuid) |
1011 | { | 1009 | { |
1012 | if (task->audit_context) { | 1010 | if (task->audit_context) { |
1013 | struct audit_buffer *ab; | 1011 | audit_log_type(NULL, AUDIT_LOGIN, 0, |
1014 | 1012 | "login pid=%d uid=%u old loginuid=%u new loginuid=%u", | |
1015 | ab = audit_log_start(NULL); | 1013 | task->pid, task->uid, task->audit_context->loginuid, |
1016 | if (ab) { | 1014 | loginuid); |
1017 | audit_log_format(ab, "login pid=%d uid=%u " | ||
1018 | "old loginuid=%u new loginuid=%u", | ||
1019 | task->pid, task->uid, | ||
1020 | task->audit_context->loginuid, loginuid); | ||
1021 | audit_set_type(ab, AUDIT_LOGIN); | ||
1022 | audit_log_end(ab); | ||
1023 | } | ||
1024 | task->audit_context->loginuid = loginuid; | 1015 | task->audit_context->loginuid = loginuid; |
1025 | } | 1016 | } |
1026 | return 0; | 1017 | return 0; |