Blame SOURCES/0221-RH-harden-files.patch

526b4e
---
526b4e
 Makefile.inc             |    2 +-
526b4e
 kpartx/Makefile          |    4 ++--
526b4e
 libmpathpersist/Makefile |    2 +-
526b4e
 mpathpersist/Makefile    |    4 ++--
526b4e
 multipath/Makefile       |    4 ++--
526b4e
 multipathd/Makefile      |    2 +-
526b4e
 6 files changed, 9 insertions(+), 9 deletions(-)
526b4e
526b4e
Index: multipath-tools-130222/Makefile.inc
526b4e
===================================================================
526b4e
--- multipath-tools-130222.orig/Makefile.inc
526b4e
+++ multipath-tools-130222/Makefile.inc
526b4e
@@ -48,7 +48,7 @@ ifndef RPM_OPT_FLAGS
526b4e
 	RPM_OPT_FLAGS = -O2 -g -pipe -Wformat-security -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4
526b4e
 endif
526b4e
 
526b4e
-LDFLAGS     += -Wl,-z,relro
526b4e
+LDFLAGS     += -Wl,-z,relro -Wl,-z,now
526b4e
 OPTFLAGS     = $(RPM_OPT_FLAGS) -Wunused -Wstrict-prototypes
526b4e
 CFLAGS	     = $(OPTFLAGS) -DLIB_STRING=\"${LIB}\"
526b4e
 SHARED_FLAGS = -shared
526b4e
Index: multipath-tools-130222/kpartx/Makefile
526b4e
===================================================================
526b4e
--- multipath-tools-130222.orig/kpartx/Makefile
526b4e
+++ multipath-tools-130222/kpartx/Makefile
526b4e
@@ -4,7 +4,7 @@
526b4e
 #
526b4e
 include ../Makefile.inc
526b4e
 
526b4e
-CFLAGS += -fPIC -I. -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
526b4e
+CFLAGS += -fPIE -DPIE -I. -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
526b4e
 
526b4e
 LIBDM_API_COOKIE = $(shell grep -Ecs '^[a-z]*[[:space:]]+dm_task_set_cookie' /usr/include/libdevmapper.h)
526b4e
 
526b4e
@@ -12,7 +12,7 @@ ifneq ($(strip $(LIBDM_API_COOKIE)),0)
526b4e
 	CFLAGS += -DLIBDM_API_COOKIE
526b4e
 endif
526b4e
 
526b4e
-LDFLAGS = -ldevmapper
526b4e
+LDFLAGS += -ldevmapper -pie
526b4e
 OBJS = bsd.o dos.o kpartx.o solaris.o unixware.o dasd.o sun.o \
526b4e
        gpt.o mac.o ps3.o crc32.o lopart.o xstrncpy.o devmapper.o
526b4e
 EXEC = kpartx
526b4e
Index: multipath-tools-130222/libmpathpersist/Makefile
526b4e
===================================================================
526b4e
--- multipath-tools-130222.orig/libmpathpersist/Makefile
526b4e
+++ multipath-tools-130222/libmpathpersist/Makefile
526b4e
@@ -21,7 +21,7 @@ all: $(LIBS)
526b4e
 
526b4e
 $(LIBS): 
526b4e
 	$(CC) -Wall -c $(CFLAGS) *.c
526b4e
-	$(CC)  -shared $(LIBDEPS) -Wl,-soname=$@ $(CFLAGS) -o $@ $(OBJS)
526b4e
+	$(CC) $(LDFLAGS) -shared $(LIBDEPS) -Wl,-soname=$@ $(CFLAGS) -o $@ $(OBJS)
526b4e
 	ln -s $(LIBS) $(DEVLIB)
526b4e
 	$(GZIP) mpath_persistent_reserve_in.3 > mpath_persistent_reserve_in.3.gz	
526b4e
 	$(GZIP) mpath_persistent_reserve_out.3 > mpath_persistent_reserve_out.3.gz	
526b4e
Index: multipath-tools-130222/mpathpersist/Makefile
526b4e
===================================================================
526b4e
--- multipath-tools-130222.orig/mpathpersist/Makefile
526b4e
+++ multipath-tools-130222/mpathpersist/Makefile
526b4e
@@ -4,8 +4,8 @@ include ../Makefile.inc
526b4e
 
526b4e
 OBJS = main.o 
526b4e
 
526b4e
-CFLAGS += -I$(multipathdir) -I$(mpathpersistdir) 
526b4e
-LDFLAGS += -lpthread -ldevmapper -L$(mpathpersistdir) -lmpathpersist -L$(multipathdir) -L$(mpathcmddir) -lmpathcmd -lmultipath -ludev
526b4e
+CFLAGS += -fPIE -DPIE -I$(multipathdir) -I$(mpathpersistdir)
526b4e
+LDFLAGS += -lpthread -ldevmapper -L$(mpathpersistdir) -lmpathpersist -L$(multipathdir) -L$(mpathcmddir) -lmpathcmd -lmultipath -ludev -pie
526b4e
 
526b4e
 EXEC = mpathpersist
526b4e
 
526b4e
Index: multipath-tools-130222/multipath/Makefile
526b4e
===================================================================
526b4e
--- multipath-tools-130222.orig/multipath/Makefile
526b4e
+++ multipath-tools-130222/multipath/Makefile
526b4e
@@ -6,9 +6,9 @@ include ../Makefile.inc
526b4e
 
526b4e
 OBJS = main.o
526b4e
 
526b4e
-CFLAGS += -I$(multipathdir) -I$(mpathcmddir)
526b4e
+CFLAGS += -fPIE -DPIE -I$(multipathdir) -I$(mpathcmddir)
526b4e
 LDFLAGS += -lpthread -ldevmapper -ldl -L$(multipathdir) -lmultipath -ludev \
526b4e
-	-L$(mpathcmddir) -lmpathcmd
526b4e
+	-L$(mpathcmddir) -lmpathcmd -pie
526b4e
 
526b4e
 EXEC = multipath
526b4e
 
526b4e
Index: multipath-tools-130222/multipathd/Makefile
526b4e
===================================================================
526b4e
--- multipath-tools-130222.orig/multipathd/Makefile
526b4e
+++ multipath-tools-130222/multipathd/Makefile
526b4e
@@ -8,7 +8,7 @@ include ../Makefile.inc
526b4e
 CFLAGS += -fPIE -DPIE -I$(multipathdir) -I$(mpathpersistdir) -I$(mpathcmddir)
526b4e
 LDFLAGS += -lpthread -ldevmapper -lreadline -ludev -ldl \
526b4e
 	   -L$(multipathdir) -lmultipath -L$(mpathpersistdir) -lmpathpersist \
526b4e
-	   -L$(mpathcmddir) -lmpathcmd -Wl,-z,now -pie
526b4e
+	   -L$(mpathcmddir) -lmpathcmd -pie
526b4e
 
526b4e
 #
526b4e
 # debuging stuff