AUDIT: Fix inconsistent use of loginuid vs. auid, signed vs. unsigned
The attached patch changes all occurrences of loginuid to auid. It also changes everything to %u that is an unsigned type. Signed-off-by: Steve Grubb <sgrubb@redhat.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
This commit is contained in:
parent
05474106a4
commit
326e9c8ba6
2 changed files with 8 additions and 11 deletions
|
@ -439,12 +439,9 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
|
||||||
if (!ab)
|
if (!ab)
|
||||||
break; /* audit_panic has been called */
|
break; /* audit_panic has been called */
|
||||||
audit_log_format(ab,
|
audit_log_format(ab,
|
||||||
"user pid=%d uid=%d length=%d loginuid=%u"
|
"user pid=%d uid=%u auid=%u"
|
||||||
" msg='%.1024s'",
|
" msg='%.1024s'",
|
||||||
pid, uid,
|
pid, uid, loginuid, (char *)data);
|
||||||
(int)(nlh->nlmsg_len
|
|
||||||
- ((char *)data - (char *)nlh)),
|
|
||||||
loginuid, (char *)data);
|
|
||||||
audit_set_pid(ab, pid);
|
audit_set_pid(ab, pid);
|
||||||
audit_log_end(ab);
|
audit_log_end(ab);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -688,9 +688,9 @@ static void audit_log_exit(struct audit_context *context)
|
||||||
context->return_code);
|
context->return_code);
|
||||||
audit_log_format(ab,
|
audit_log_format(ab,
|
||||||
" a0=%lx a1=%lx a2=%lx a3=%lx items=%d"
|
" a0=%lx a1=%lx a2=%lx a3=%lx items=%d"
|
||||||
" pid=%d loginuid=%d uid=%d gid=%d"
|
" pid=%d auid=%u uid=%u gid=%u"
|
||||||
" euid=%d suid=%d fsuid=%d"
|
" euid=%u suid=%u fsuid=%u"
|
||||||
" egid=%d sgid=%d fsgid=%d",
|
" egid=%u sgid=%u fsgid=%u",
|
||||||
context->argv[0],
|
context->argv[0],
|
||||||
context->argv[1],
|
context->argv[1],
|
||||||
context->argv[2],
|
context->argv[2],
|
||||||
|
@ -717,7 +717,7 @@ static void audit_log_exit(struct audit_context *context)
|
||||||
case AUDIT_IPC: {
|
case AUDIT_IPC: {
|
||||||
struct audit_aux_data_ipcctl *axi = (void *)aux;
|
struct audit_aux_data_ipcctl *axi = (void *)aux;
|
||||||
audit_log_format(ab,
|
audit_log_format(ab,
|
||||||
" qbytes=%lx iuid=%d igid=%d mode=%x",
|
" qbytes=%lx iuid=%u igid=%u mode=%x",
|
||||||
axi->qbytes, axi->uid, axi->gid, axi->mode);
|
axi->qbytes, axi->uid, axi->gid, axi->mode);
|
||||||
break; }
|
break; }
|
||||||
|
|
||||||
|
@ -761,7 +761,7 @@ static void audit_log_exit(struct audit_context *context)
|
||||||
}
|
}
|
||||||
if (context->names[i].ino != (unsigned long)-1)
|
if (context->names[i].ino != (unsigned long)-1)
|
||||||
audit_log_format(ab, " inode=%lu dev=%02x:%02x mode=%#o"
|
audit_log_format(ab, " inode=%lu dev=%02x:%02x mode=%#o"
|
||||||
" ouid=%d ogid=%d rdev=%02x:%02x",
|
" ouid=%u ogid=%u rdev=%02x:%02x",
|
||||||
context->names[i].ino,
|
context->names[i].ino,
|
||||||
MAJOR(context->names[i].dev),
|
MAJOR(context->names[i].dev),
|
||||||
MINOR(context->names[i].dev),
|
MINOR(context->names[i].dev),
|
||||||
|
@ -1063,7 +1063,7 @@ int audit_set_loginuid(struct task_struct *task, uid_t loginuid)
|
||||||
ab = audit_log_start(NULL, AUDIT_LOGIN);
|
ab = audit_log_start(NULL, AUDIT_LOGIN);
|
||||||
if (ab) {
|
if (ab) {
|
||||||
audit_log_format(ab, "login pid=%d uid=%u "
|
audit_log_format(ab, "login pid=%d uid=%u "
|
||||||
"old loginuid=%u new loginuid=%u",
|
"old auid=%u new auid=%u",
|
||||||
task->pid, task->uid,
|
task->pid, task->uid,
|
||||||
task->audit_context->loginuid, loginuid);
|
task->audit_context->loginuid, loginuid);
|
||||||
audit_log_end(ab);
|
audit_log_end(ab);
|
||||||
|
|
Loading…
Reference in a new issue