[systemd-commits] Makefile.am src/logind-acl.h
Lennart Poettering
lennart at kemper.freedesktop.org
Mon Jul 11 13:30:20 PDT 2011
Makefile.am | 12 +++++++++---
src/logind-acl.h | 20 ++++++++++++++++++++
2 files changed, 29 insertions(+), 3 deletions(-)
New commits:
commit 2fb1aedaf2493d9598693c123d5e9c168ca1b3c1
Author: Zbigniew JÄdrzejewski-Szmek <zbyszek at in.waw.pl>
Date: Mon Jul 11 22:29:45 2011 +0200
logind: Fix compilation without ACL
Compilation fails if sys/acl.h is not available. The configure script
already tests for sys/acl.h presence, but the result was so far unused.
To compile without acl, stub implementations of the acl functions are
used.
diff --git a/Makefile.am b/Makefile.am
index 4acdb2e..ca2c437 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -885,7 +885,6 @@ systemd_logind_SOURCES = \
src/logind-session-dbus.c \
src/logind-user.c \
src/logind-user-dbus.c \
- src/logind-acl.c \
src/dbus-common.c \
src/dbus-loop.c \
src/cgroup-util.c \
@@ -905,8 +904,15 @@ systemd_logind_LDADD = \
$(ACL_LIBS)
systemd_uaccess_SOURCES = \
- src/uaccess.c \
- src/logind-acl.c
+ src/uaccess.c
+
+if HAVE_ACL
+systemd_logind_SOURCES += \
+ src/logind-acl.c
+
+systemd_uaccess_SOURCES += \
+ src/logind-acl.c
+endif
systemd_uaccess_CFLAGS = \
$(AM_CFLAGS) \
diff --git a/src/logind-acl.h b/src/logind-acl.h
index 9c88a80..72740f5 100644
--- a/src/logind-acl.h
+++ b/src/logind-acl.h
@@ -26,6 +26,8 @@
#include <stdbool.h>
#include <libudev.h>
+#ifdef HAVE_ACL
+
int devnode_acl(const char *path,
bool flush,
bool del, uid_t old_uid,
@@ -36,5 +38,23 @@ int devnode_acl_all(struct udev *udev,
bool flush,
bool del, uid_t old_uid,
bool add, uid_t new_uid);
+#else
+
+static inline int devnode_acl(const char *path,
+ bool flush,
+ bool del, uid_t old_uid,
+ bool add, uid_t new_uid) {
+ return 0;
+}
+
+static inline int devnode_acl_all(struct udev *udev,
+ const char *seat,
+ bool flush,
+ bool del, uid_t old_uid,
+ bool add, uid_t new_uid) {
+ return 0;
+}
+
+#endif
#endif
More information about the systemd-commits
mailing list