X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fshared%2Faudit.c;h=97560cc9a3f462e9461b250914baf8778af16294;hp=38500591320fb27e6b1d5a23303d2b69177ff843;hb=2f79c10e9aef916efbcf29315eea8c25d0a50ac4;hpb=d7832d2c6e0ef5f2839a2296c1cc2fc85c7d9632 diff --git a/src/shared/audit.c b/src/shared/audit.c index 385005913..97560cc9a 100644 --- a/src/shared/audit.c +++ b/src/shared/audit.c @@ -6,16 +6,16 @@ Copyright 2010 Lennart Poettering systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + 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 - General Public License for more details. + Lesser General Public License for more details. - You should have received a copy of the GNU General Public License + You should have received a copy of the GNU Lesser General Public License along with systemd; If not, see . ***/ @@ -33,6 +33,8 @@ #include "audit.h" #include "util.h" #include "log.h" +#include "fileio.h" +#include "virt.h" int audit_session_from_pid(pid_t pid, uint32_t *id) { char *s; @@ -44,6 +46,10 @@ int audit_session_from_pid(pid_t pid, uint32_t *id) { if (have_effective_cap(CAP_AUDIT_CONTROL) <= 0) return -ENOENT; + /* Audit doesn't support containers right now */ + if (detect_container(NULL) > 0) + return -ENOTSUP; + if (pid == 0) r = read_one_line_file("/proc/self/sessionid", &s); else { @@ -89,6 +95,10 @@ int audit_loginuid_from_pid(pid_t pid, uid_t *uid) { if (have_effective_cap(CAP_AUDIT_CONTROL) <= 0) return -ENOENT; + /* Audit doesn't support containers right now */ + if (detect_container(NULL) > 0) + return -ENOTSUP; + if (pid == 0) r = read_one_line_file("/proc/self/loginuid", &s); else {