diff options
author | Richard Guy Briggs <rgb@redhat.com> | 2018-05-13 03:58:19 +0200 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2018-05-14 21:56:35 +0200 |
commit | f0b752168d7091f38e7d61a80de2542e8b71d266 (patch) | |
tree | ac6396e791a3c8e200eda5489344158529d4e5cb /kernel/auditsc.c | |
parent | seccomp: Don't special case audited processes when logging (diff) | |
download | linux-f0b752168d7091f38e7d61a80de2542e8b71d266.tar.xz linux-f0b752168d7091f38e7d61a80de2542e8b71d266.zip |
audit: convert sessionid unset to a macro
Use a macro, "AUDIT_SID_UNSET", to replace each instance of
initialization and comparison to an audit session ID.
Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to '')
-rw-r--r-- | kernel/auditsc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 0d4e7ab847b1..378c45b92775 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c @@ -2050,7 +2050,7 @@ static void audit_log_set_loginuid(kuid_t koldloginuid, kuid_t kloginuid, int audit_set_loginuid(kuid_t loginuid) { struct task_struct *task = current; - unsigned int oldsessionid, sessionid = (unsigned int)-1; + unsigned int oldsessionid, sessionid = AUDIT_SID_UNSET; kuid_t oldloginuid; int rc; @@ -2064,7 +2064,7 @@ int audit_set_loginuid(kuid_t loginuid) /* are we setting or clearing? */ if (uid_valid(loginuid)) { sessionid = (unsigned int)atomic_inc_return(&session_id); - if (unlikely(sessionid == (unsigned int)-1)) + if (unlikely(sessionid == AUDIT_SID_UNSET)) sessionid = (unsigned int)atomic_inc_return(&session_id); } |