summaryrefslogtreecommitdiff
path: root/src/basic/audit-util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/basic/audit-util.h')
-rw-r--r--src/basic/audit-util.h24
1 files changed, 5 insertions, 19 deletions
diff --git a/src/basic/audit-util.h b/src/basic/audit-util.h
index b16ca585b..e57a38425 100644
--- a/src/basic/audit-util.h
+++ b/src/basic/audit-util.h
@@ -1,24 +1,6 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
-/***
- This file is part of systemd.
-
- Copyright 2010 Lennart Poettering
-
- systemd is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 of the License, or
- (at your option) any later version.
-
- systemd is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with systemd; If not, see <http://www.gnu.org/licenses/>.
-***/
-
#include <stdbool.h>
#include <stdint.h>
#include <sys/types.h>
@@ -31,3 +13,7 @@ int audit_loginuid_from_pid(pid_t pid, uid_t *uid);
#if 0 /// UNNEEDED by elogind
bool use_audit(void);
#endif // 0
+
+static inline bool audit_session_is_valid(uint32_t id) {
+ return id > 0 && id != AUDIT_SESSION_INVALID;
+}