summaryrefslogtreecommitdiff
path: root/src/basic/audit-util.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-07-14 18:42:17 +0200
committerLennart Poettering <lennart@poettering.net>2017-07-31 18:01:42 +0200
commit3a87a86e33c20aab20d8b221adae2015d12bbb80 (patch)
tree9eaa3483c7e5e1f34a5ace9fa50ebf378aa2d26a /src/basic/audit-util.h
parentab7e3ef561e5c1ff63b58f4a329a9f90f0768eb0 (diff)
downloadsystemd-3a87a86e33c20aab20d8b221adae2015d12bbb80.tar.gz
systemd-3a87a86e33c20aab20d8b221adae2015d12bbb80.tar.bz2
systemd-3a87a86e33c20aab20d8b221adae2015d12bbb80.zip
audit: introduce audit_session_is_valid() and make use of it everywhere
Let's add a proper validation function, since validation isn't entirely trivial. Make use of it where applicable. Also make use of AUDIT_SESSION_INVALID where we need a marker for an invalid audit session.
Diffstat (limited to 'src/basic/audit-util.h')
-rw-r--r--src/basic/audit-util.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/basic/audit-util.h b/src/basic/audit-util.h
index e048503991..3088951326 100644
--- a/src/basic/audit-util.h
+++ b/src/basic/audit-util.h
@@ -29,3 +29,7 @@ int audit_session_from_pid(pid_t pid, uint32_t *id);
int audit_loginuid_from_pid(pid_t pid, uid_t *uid);
bool use_audit(void);
+
+static inline bool audit_session_is_valid(uint32_t id) {
+ return id > 0 && id != AUDIT_SESSION_INVALID;
+}