summaryrefslogtreecommitdiffstats
path: root/package/policycoreutils/0005-Check-to-see-if-DBUS-is-enabled.patch
blob: 37ffac8de86d463fc1be2a848e2f582968394163 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
From d1bc28c5b2efe60a0ee04d9c171928d0f3475654 Mon Sep 17 00:00:00 2001
From: Adam Duskett <Aduskett@gmail.com>
Date: Thu, 14 Jul 2016 13:26:23 -0400
Subject: [PATCH] Check to see if DBUS is enabled.

Adds a condition to prevent linking against dbus when at build time
dbus has not been enabled.

Updated for 2.5.

Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
Signed-off-by: Adam Duskett <AdamDuskett@outlook.com>
Signed-off-by: Adam Duskett <Aduskett@gmail.com>
---
 policycoreutils/restorecond/Makefile | 2 ++
 policycoreutils/restorecond/user.c   | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/restorecond/Makefile b/restorecond/Makefile
index 92a4a4d..95f38a6 100644
--- a/restorecond/Makefile
+++ b/restorecond/Makefile
@@ -11,8 +11,10 @@ autostart_DATA = sealertauto.desktop
 INITDIR ?= $(DESTDIR)/etc/rc.d/init.d
 SELINUXDIR = $(DESTDIR)/etc/selinux
 
+ifdef ENABLE_DBUS
 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
 DBUSLIB = -ldbus-glib-1 -ldbus-1
+endif
 
 CFLAGS ?= -g -Werror -Wall -W
 override CFLAGS += -I$(DESTDIR)/usr/include $(DBUSFLAGS) -I$(DESTDIR)/usr/include/glib-2.0 \
diff --git a/restorecond/user.c b/restorecond/user.c
index 714aae7..a04cddb 100644
--- a/restorecond/user.c
+++ b/restorecond/user.c
@@ -54,7 +54,6 @@ static const char *PATH="/org/selinux/Restorecond";
 static const char *INTERFACE="org.selinux.RestorecondIface";
 static const char *RULE="type='signal',interface='org.selinux.RestorecondIface'";
 
-static int local_lock_fd = -1;
 
 static DBusHandlerResult
 signal_filter (DBusConnection *connection  __attribute__ ((__unused__)), DBusMessage *message, void *user_data)
@@ -101,6 +100,7 @@ static int dbus_server(GMainLoop *loop) {
 #include <selinux/selinux.h>
 #include <sys/file.h>
 
+static int local_lock_fd = -1;
 /* size of the event structure, not counting name */
 #define EVENT_SIZE  (sizeof (struct inotify_event))
 /* reasonable guess as to size of 1024 events */
-- 
2.7.4

OpenPOWER on IntegriCloud