0005-Check-to-see-if-DBUS-is-enabled.patch 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. From d1bc28c5b2efe60a0ee04d9c171928d0f3475654 Mon Sep 17 00:00:00 2001
  2. From: Adam Duskett <Aduskett@gmail.com>
  3. Date: Thu, 14 Jul 2016 13:26:23 -0400
  4. Subject: [PATCH] Check to see if DBUS is enabled.
  5. Adds a condition to prevent linking against dbus when at build time
  6. dbus has not been enabled.
  7. Updated for 2.5.
  8. Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
  9. Signed-off-by: Adam Duskett <AdamDuskett@outlook.com>
  10. Signed-off-by: Adam Duskett <Aduskett@gmail.com>
  11. ---
  12. policycoreutils/restorecond/Makefile | 2 ++
  13. policycoreutils/restorecond/user.c | 2 +-
  14. 2 files changed, 3 insertions(+), 1 deletion(-)
  15. diff --git a/restorecond/Makefile b/restorecond/Makefile
  16. index 92a4a4d..95f38a6 100644
  17. --- a/restorecond/Makefile
  18. +++ b/restorecond/Makefile
  19. @@ -11,8 +11,10 @@ autostart_DATA = sealertauto.desktop
  20. INITDIR ?= $(DESTDIR)/etc/rc.d/init.d
  21. SELINUXDIR = $(DESTDIR)/etc/selinux
  22. +ifdef ENABLE_DBUS
  23. DBUSFLAGS = -DHAVE_DBUS -I$(DESTDIR)/usr/include/dbus-1.0 -I$(DESTDIR)/usr/lib64/dbus-1.0/include -I$(DESTDIR)/usr/lib/dbus-1.0/include
  24. DBUSLIB = -ldbus-glib-1 -ldbus-1
  25. +endif
  26. CFLAGS ?= -g -Werror -Wall -W
  27. override CFLAGS += -I$(DESTDIR)/usr/include $(DBUSFLAGS) -I$(DESTDIR)/usr/include/glib-2.0 \
  28. diff --git a/restorecond/user.c b/restorecond/user.c
  29. index 714aae7..a04cddb 100644
  30. --- a/restorecond/user.c
  31. +++ b/restorecond/user.c
  32. @@ -54,7 +54,6 @@ static const char *PATH="/org/selinux/Restorecond";
  33. static const char *INTERFACE="org.selinux.RestorecondIface";
  34. static const char *RULE="type='signal',interface='org.selinux.RestorecondIface'";
  35. -static int local_lock_fd = -1;
  36. static DBusHandlerResult
  37. signal_filter (DBusConnection *connection __attribute__ ((__unused__)), DBusMessage *message, void *user_data)
  38. @@ -101,6 +100,7 @@ static int dbus_server(GMainLoop *loop) {
  39. #include <selinux/selinux.h>
  40. #include <sys/file.h>
  41. +static int local_lock_fd = -1;
  42. /* size of the event structure, not counting name */
  43. #define EVENT_SIZE (sizeof (struct inotify_event))
  44. /* reasonable guess as to size of 1024 events */
  45. --
  46. 2.7.4