31786f0
From 436ac9074def43ae09d7ecc28eec6cdc77a9d0e2 Mon Sep 17 00:00:00 2001
31786f0
From: Chris Leech <cleech@redhat.com>
31786f0
Date: Fri, 13 Sep 2013 16:56:51 -0700
31786f0
Subject: [PATCH 65/65] fix hardened build of iscsiuio
31786f0
31786f0
The new iscsiuio code sets CFLAGS in configure.ac, wiping out the
31786f0
environment setup by rpm.  Patch that out.
31786f0
31786f0
Also fix local build when iscsi-initiator-utils is installed, but having
31786f0
the check to prevent overwriting configuration files during install look
31786f0
in DESTDIR.
31786f0
---
31786f0
 Makefile              | 2 +-
31786f0
 iscsiuio/configure    | 2 +-
31786f0
 iscsiuio/configure.ac | 2 +-
31786f0
 3 files changed, 3 insertions(+), 3 deletions(-)
31786f0
 mode change 100644 => 100755 iscsiuio/configure
31786f0
31786f0
diff --git a/Makefile b/Makefile
31786f0
index 02346bf..172d30e 100644
31786f0
--- a/Makefile
31786f0
+++ b/Makefile
31786f0
@@ -123,7 +123,7 @@ install_iface: $(IFACEFILES)
31786f0
 	$(INSTALL) -m 644 $^ $(DESTDIR)$(etcdir)/iscsi/ifaces
31786f0
 
31786f0
 install_etc: $(ETCFILES)
31786f0
-	if [ ! -f /etc/iscsi/iscsid.conf ]; then \
31786f0
+	if [ ! -f $(DESTDIR)$(etcdir)/iscsi/iscsid.conf ]; then \
31786f0
 		$(INSTALL) -d $(DESTDIR)$(etcdir)/iscsi ; \
31786f0
 		$(INSTALL) -m 644 $^ $(DESTDIR)$(etcdir)/iscsi ; \
31786f0
 	fi
31786f0
diff --git a/iscsiuio/configure b/iscsiuio/configure
31786f0
old mode 100644
31786f0
new mode 100755
31786f0
index 2740598..cd13f92
31786f0
--- a/iscsiuio/configure
31786f0
+++ b/iscsiuio/configure
31786f0
@@ -21288,7 +21288,7 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool'
31786f0
 
31786f0
 
31786f0
 
31786f0
-CFLAGS="-O2 -Wall"
31786f0
+CFLAGS="${CFLAGS} -O2 -Wall"
31786f0
 ## check for --enable-debug first before checking CFLAGS before
31786f0
 ## so that we don't mix -O and -g
31786f0
 # Check whether --enable-debug or --disable-debug was given.
31786f0
diff --git a/iscsiuio/configure.ac b/iscsiuio/configure.ac
31786f0
index e9a5e32..d9a6bdb 100644
31786f0
--- a/iscsiuio/configure.ac
31786f0
+++ b/iscsiuio/configure.ac
31786f0
@@ -52,7 +52,7 @@ AC_LIBTOOL_DLOPEN
31786f0
 # libtool stuff
31786f0
 AC_PROG_LIBTOOL
31786f0
 
31786f0
-CFLAGS="-O2 -Wall"
31786f0
+CFLAGS="${CFLAGS} -O2 -Wall"
31786f0
 ## check for --enable-debug first before checking CFLAGS before
31786f0
 ## so that we don't mix -O and -g
31786f0
 AC_ARG_ENABLE(debug,
31786f0
-- 
31786f0
1.8.1.4
31786f0