Skip to contentSkip to conversation

restorecond: Do not link against libpcre

PATCH Applied Laurent Bigonville 3 participants 3 messages Mar 21, 2019 – Mar 26, 2019 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 restorecond: Do not link against libpcre

From: Laurent Bigonville <[email protected]>

For some reasons, restorecond was explicitly linking against libpcre but the code is not using any of its symbols

---
 restorecond/Makefile | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
restorecond/Makefile +1 -11
index b81f8c82..12452cd2 100644
@@ -19,17 +19,7 @@ DBUSLIB = $(shell $(PKG_CONFIG) --libs dbus-glib-1)
 CFLAGS ?= -g -Werror -Wall -W
 override CFLAGS += $(DBUSFLAGS)
 
-USE_PCRE2 ?= n
-ifeq ($(USE_PCRE2),y)
-	PCRE_CFLAGS := -DUSE_PCRE2 -DPCRE2_CODE_UNIT_WIDTH=8 $(shell $(PKG_CONFIG) --cflags libpcre2-8)
-	PCRE_LDLIBS := $(shell $(PKG_CONFIG) --libs libpcre2-8)
-else
-	PCRE_CFLAGS := $(shell $(PKG_CONFIG) --cflags libpcre)
-	PCRE_LDLIBS := $(shell $(PKG_CONFIG) --libs libpcre)
-endif
-export PCRE_CFLAGS PCRE_LDLIBS
-
-override LDLIBS += -lselinux $(PCRE_LDLIBS) $(DBUSLIB)
+override LDLIBS += -lselinux $(DBUSLIB)
 
 all: restorecond
 
Signature · 1 line
2.20.1
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Laurent Bigonville

From: Laurent Bigonville <[email protected]>

For some reasons, restorecond was explicitly linking against libpcre but the code is not using any of its symbols

It looks likes it was accidentally added by commit 50f0910cf05bdc1d10710c7c3fb748a178473387 ("libselinux: add support for pcre2")

Quoted 28 lines
---
 restorecond/Makefile | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
restorecond/Makefile +1 -11
index b81f8c82..12452cd2 100644
@@ -19,17 +19,7 @@ DBUSLIB = $(shell $(PKG_CONFIG) --libs 
 dbus-glib-1)
 CFLAGS ?= -g -Werror -Wall -W
 override CFLAGS += $(DBUSFLAGS)
 
-USE_PCRE2 ?= n
-ifeq ($(USE_PCRE2),y)
-	PCRE_CFLAGS := -DUSE_PCRE2 -DPCRE2_CODE_UNIT_WIDTH=8 
 $(shell $(PKG_CONFIG) --cflags libpcre2-8)
-	PCRE_LDLIBS := $(shell $(PKG_CONFIG) --libs libpcre2-8)
-else
-	PCRE_CFLAGS := $(shell $(PKG_CONFIG) --cflags libpcre)
-	PCRE_LDLIBS := $(shell $(PKG_CONFIG) --libs libpcre)
-endif
-export PCRE_CFLAGS PCRE_LDLIBS
-
-override LDLIBS += -lselinux $(PCRE_LDLIBS) $(DBUSLIB)
+override LDLIBS += -lselinux $(DBUSLIB)
 

all: restorecond

#2 lore raw
Quoted 12 lines · Petr Lautrbach
Quoted 8 lines · Laurent Bigonville

From: Laurent Bigonville <[email protected]>

For some reasons, restorecond was explicitly linking against libpcre but
the code is not using any of its symbols

Quoted 8 lines
Quoted 1 line

It looks likes it was accidentally added by commit 50f0910cf05bdc1d10710c7c3fb748a178473387 ("libselinux: add support for pcre2")

Merged, Thanks.
Nicolas

Quoted 29 lines
Quoted 28 lines
---
 restorecond/Makefile | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
restorecond/Makefile +1 -11
index b81f8c82..12452cd2 100644
@@ -19,17 +19,7 @@ DBUSLIB = $(shell $(PKG_CONFIG) --libs
 dbus-glib-1)
 CFLAGS ?= -g -Werror -Wall -W
 override CFLAGS += $(DBUSFLAGS)
 
-USE_PCRE2 ?= n
-ifeq ($(USE_PCRE2),y)
-     PCRE_CFLAGS := -DUSE_PCRE2 -DPCRE2_CODE_UNIT_WIDTH=8
 $(shell $(PKG_CONFIG) --cflags libpcre2-8)
-     PCRE_LDLIBS := $(shell $(PKG_CONFIG) --libs libpcre2-8)
-else
-     PCRE_CFLAGS := $(shell $(PKG_CONFIG) --cflags libpcre)
-     PCRE_LDLIBS := $(shell $(PKG_CONFIG) --libs libpcre)
-endif
-export PCRE_CFLAGS PCRE_LDLIBS
-
-override LDLIBS += -lselinux $(PCRE_LDLIBS) $(DBUSLIB)
+override LDLIBS += -lselinux $(DBUSLIB)
 

all: restorecond