[systemd-commits] Makefile.am src/journal
Lennart Poettering
lennart at kemper.freedesktop.org
Wed Jan 11 11:40:42 PST 2012
Makefile.am | 6 +++++-
src/journal/journald.c | 15 +++++++++++----
2 files changed, 16 insertions(+), 5 deletions(-)
New commits:
commit e6520a0fcebb4d5e07f4c81a51382501b0beb22f
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Jan 11 20:40:01 2012 +0100
journal: make requirement for ACLs optional
diff --git a/Makefile.am b/Makefile.am
index 4bb0609..42da4fb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1208,9 +1208,13 @@ systemd_journald_SOURCES = \
src/journal/lookup3.c \
src/journal/journal-rate-limit.c \
src/sd-id128.c \
- src/acl-util.c \
src/cgroup-util.c
+if HAVE_ACL
+systemd_journald_SOURCES += \
+ src/acl-util.c
+endif
+
nodist_systemd_journald_SOURCES = \
src/journal/journald-gperf.c
diff --git a/src/journal/journald.c b/src/journal/journald.c
index d020309..0194a1b 100644
--- a/src/journal/journald.c
+++ b/src/journal/journald.c
@@ -25,8 +25,6 @@
#include <sys/signalfd.h>
#include <unistd.h>
#include <fcntl.h>
-#include <sys/acl.h>
-#include <acl/libacl.h>
#include <stddef.h>
#include <sys/ioctl.h>
#include <linux/sockios.h>
@@ -40,7 +38,6 @@
#include "hashmap.h"
#include "journal-file.h"
#include "socket-util.h"
-#include "acl-util.h"
#include "cgroup-util.h"
#include "list.h"
#include "journal-rate-limit.h"
@@ -49,6 +46,12 @@
#include "journald.h"
#include "virt.h"
+#ifdef HAVE_ACL
+#include <sys/acl.h>
+#include <acl/libacl.h>
+#include "acl-util.h"
+#endif
+
#define USER_JOURNALS_MAX 1024
#define STDOUT_STREAMS_MAX 4096
@@ -181,10 +184,12 @@ finish:
}
static void fix_perms(JournalFile *f, uid_t uid) {
+ int r;
+#ifdef HAVE_ACL
acl_t acl;
acl_entry_t entry;
acl_permset_t permset;
- int r;
+#endif
assert(f);
@@ -192,6 +197,7 @@ static void fix_perms(JournalFile *f, uid_t uid) {
if (r < 0)
log_warning("Failed to fix access mode/rights on %s, ignoring: %s", f->path, strerror(-r));
+#ifdef HAVE_ACL
if (uid <= 0)
return;
@@ -224,6 +230,7 @@ static void fix_perms(JournalFile *f, uid_t uid) {
finish:
acl_free(acl);
+#endif
}
static JournalFile* find_journal(Server *s, uid_t uid) {
More information about the systemd-commits
mailing list