summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRichard Guy Briggs <rgb@redhat.com>2018-05-13 03:58:19 +0200
committerPaul Moore <paul@paul-moore.com>2018-05-14 21:56:35 +0200
commitf0b752168d7091f38e7d61a80de2542e8b71d266 (patch)
treeac6396e791a3c8e200eda5489344158529d4e5cb /include
parentseccomp: Don't special case audited processes when logging (diff)
downloadlinux-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 'include')
-rw-r--r--include/linux/audit.h2
-rw-r--r--include/net/xfrm.h2
-rw-r--r--include/uapi/linux/audit.h1
3 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h
index b639cf1f55ff..2d15bce7aa3c 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -510,7 +510,7 @@ static inline kuid_t audit_get_loginuid(struct task_struct *tsk)
}
static inline unsigned int audit_get_sessionid(struct task_struct *tsk)
{
- return -1;
+ return AUDIT_SID_UNSET;
}
static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp)
{ }
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index a872379b69da..fcce8eef6c70 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -751,7 +751,7 @@ static inline void xfrm_audit_helper_usrinfo(bool task_valid,
audit_get_loginuid(current) :
INVALID_UID);
const unsigned int ses = task_valid ? audit_get_sessionid(current) :
- (unsigned int) -1;
+ AUDIT_SID_UNSET;
audit_log_format(audit_buf, " auid=%u ses=%u", auid, ses);
audit_log_task_context(audit_buf);
diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h
index 4e61a9e05132..04f9bd249094 100644
--- a/include/uapi/linux/audit.h
+++ b/include/uapi/linux/audit.h
@@ -465,6 +465,7 @@ struct audit_tty_status {
};
#define AUDIT_UID_UNSET (unsigned int)-1
+#define AUDIT_SID_UNSET ((unsigned int)-1)
/* audit_rule_data supports filter rules with both integer and string
* fields. It corresponds with AUDIT_ADD_RULE, AUDIT_DEL_RULE and