From 9257446cc4a871acb7a19467c627d3fc570dcf52 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Mar 05 2018 11:36:59 +0000 Subject: Simplify hardening flags handling --- diff --git a/cyrus-sasl-2.1.26-relro.patch b/cyrus-sasl-2.1.26-relro.patch deleted file mode 100644 index f8b6027..0000000 --- a/cyrus-sasl-2.1.26-relro.patch +++ /dev/null @@ -1,70 +0,0 @@ -diff -up cyrus-sasl-2.1.26/lib/Makefile.am.relro cyrus-sasl-2.1.26/lib/Makefile.am ---- cyrus-sasl-2.1.26/lib/Makefile.am.relro 2012-10-12 16:05:48.000000000 +0200 -+++ cyrus-sasl-2.1.26/lib/Makefile.am 2013-02-11 14:18:01.749053772 +0100 -@@ -64,7 +64,7 @@ LIB_DOOR= @LIB_DOOR@ - lib_LTLIBRARIES = libsasl2.la - - libsasl2_la_SOURCES = $(common_sources) $(common_headers) --libsasl2_la_LDFLAGS = -version-info $(sasl_version) -+libsasl2_la_LDFLAGS = -Wl,-z,relro -version-info $(sasl_version) - libsasl2_la_DEPENDENCIES = $(LTLIBOBJS) - libsasl2_la_LIBADD = $(LTLIBOBJS) $(SASL_DL_LIB) $(LIB_SOCKET) $(LIB_DOOR) - -diff -up cyrus-sasl-2.1.26/lib/Makefile.in.relro cyrus-sasl-2.1.26/lib/Makefile.in ---- cyrus-sasl-2.1.26/lib/Makefile.in.relro 2013-11-13 16:55:09.606555125 +0100 -+++ cyrus-sasl-2.1.26/lib/Makefile.in 2013-11-13 16:56:43.331096795 +0100 -@@ -330,7 +330,7 @@ common_headers = saslint.h - common_sources = auxprop.c canonusr.c checkpw.c client.c common.c config.c external.c md5.c saslutil.c server.c seterror.c dlopen.c ../plugins/plugin_common.c - lib_LTLIBRARIES = libsasl2.la - libsasl2_la_SOURCES = $(common_sources) $(common_headers) --libsasl2_la_LDFLAGS = -version-info $(sasl_version) -+libsasl2_la_LDFLAGS = -Wl,-z,relro -version-info $(sasl_version) - libsasl2_la_DEPENDENCIES = $(LTLIBOBJS) - libsasl2_la_LIBADD = $(LTLIBOBJS) $(SASL_DL_LIB) $(LIB_SOCKET) $(LIB_DOOR) - @MACOSX_TRUE@framedir = /Library/Frameworks/SASL2.framework -diff -up cyrus-sasl-2.1.26/plugins/Makefile.am.relro cyrus-sasl-2.1.26/plugins/Makefile.am ---- cyrus-sasl-2.1.26/plugins/Makefile.am.relro 2012-10-12 16:05:48.000000000 +0200 -+++ cyrus-sasl-2.1.26/plugins/Makefile.am 2013-02-11 14:18:01.749053772 +0100 -@@ -50,7 +50,7 @@ - plugin_version = 3:0:0 - - INCLUDES=-I$(top_srcdir)/include -I$(top_srcdir)/lib -I$(top_srcdir)/sasldb -I$(top_builddir)/include --AM_LDFLAGS = -module -export-dynamic -rpath $(plugindir) -version-info $(plugin_version) -+AM_LDFLAGS = -Wl,-z,relro -module -export-dynamic -rpath $(plugindir) -version-info $(plugin_version) - - COMPAT_OBJS = @LTGETADDRINFOOBJS@ @LTGETNAMEINFOOBJS@ @LTSNPRINTFOBJS@ - -diff -up cyrus-sasl-2.1.26/plugins/Makefile.in.relro cyrus-sasl-2.1.26/plugins/Makefile.in ---- cyrus-sasl-2.1.26/plugins/Makefile.in.relro 2013-11-13 16:57:08.430974081 +0100 -+++ cyrus-sasl-2.1.26/plugins/Makefile.in 2013-11-13 16:57:58.911727846 +0100 -@@ -364,7 +364,7 @@ top_srcdir = @top_srcdir@ - # CURRENT:REVISION:AGE - plugin_version = 3:0:0 - INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/lib -I$(top_srcdir)/sasldb -I$(top_builddir)/include --AM_LDFLAGS = -module -export-dynamic -rpath $(plugindir) -version-info $(plugin_version) -+AM_LDFLAGS = -Wl,-z,relro -module -export-dynamic -rpath $(plugindir) -version-info $(plugin_version) - COMPAT_OBJS = @LTGETADDRINFOOBJS@ @LTGETNAMEINFOOBJS@ @LTSNPRINTFOBJS@ - EXTRA_DIST = makeinit.sh NTMakefile - noinst_SCRIPTS = makeinit.sh -diff -up cyrus-sasl-2.1.26/saslauthd/Makefile.am.relro cyrus-sasl-2.1.26/saslauthd/Makefile.am ---- cyrus-sasl-2.1.26/saslauthd/Makefile.am.relro 2013-02-11 14:18:36.910900647 +0100 -+++ cyrus-sasl-2.1.26/saslauthd/Makefile.am 2013-02-11 14:20:17.336463915 +0100 -@@ -17,6 +17,7 @@ saslauthd_DEPENDENCIES = saslauthd-main. - saslauthd_LDADD = @SASL_KRB_LIB@ \ - @GSSAPIBASE_LIBS@ @GSSAPI_LIBS@ @LIB_CRYPT@ @LIB_SIA@ \ - @LIB_SOCKET@ @SASL_DB_LIB@ @LIB_PAM@ @LDAP_LIBS@ @LTLIBOBJS@ -+saslauthd_LDFLAGS = -pie -Wl,-z,now - - testsaslauthd_SOURCES = testsaslauthd.c utils.c - testsaslauthd_LDADD = @LIB_SOCKET@ -diff -up cyrus-sasl-2.1.26/saslauthd/Makefile.in.relro cyrus-sasl-2.1.26/saslauthd/Makefile.in ---- cyrus-sasl-2.1.26/saslauthd/Makefile.in.relro 2013-11-13 16:58:13.085659148 +0100 -+++ cyrus-sasl-2.1.26/saslauthd/Makefile.in 2013-11-13 16:58:49.679481841 +0100 -@@ -234,6 +234,7 @@ saslauthd_DEPENDENCIES = saslauthd-main. - saslauthd_LDADD = @SASL_KRB_LIB@ \ - @GSSAPIBASE_LIBS@ @GSSAPI_LIBS@ @LIB_CRYPT@ @LIB_SIA@ \ - @LIB_SOCKET@ @SASL_DB_LIB@ @LIB_PAM@ @LDAP_LIBS@ @LTLIBOBJS@ -+saslauthd_LDFLAGS = -pie -Wl,-z,now - - testsaslauthd_SOURCES = testsaslauthd.c utils.c - testsaslauthd_LDADD = @LIB_SOCKET@ diff --git a/cyrus-sasl.spec b/cyrus-sasl.spec index 3282ee6..686b301 100644 --- a/cyrus-sasl.spec +++ b/cyrus-sasl.spec @@ -31,7 +31,6 @@ Patch32: cyrus-sasl-2.1.26-warnings.patch Patch34: cyrus-sasl-2.1.22-ldap-timeout.patch # removed due to #759334 #Patch38: cyrus-sasl-2.1.23-pam_rhosts.patch -Patch42: cyrus-sasl-2.1.26-relro.patch # https://bugzilla.redhat.com/show_bug.cgi?id=816250 Patch43: cyrus-sasl-2.1.26-null-crypt.patch Patch44: cyrus-sasl-2.1.26-release-server_creds.patch @@ -201,7 +200,6 @@ chmod -x include/*.h %patch31 -p1 -b .krb4 %patch32 -p1 -b .warnings %patch34 -p1 -b .ldap-timeout -%patch42 -p1 -b .relro %patch43 -p1 -b .null-crypt %patch44 -p1 -b .release-server_creds %patch45 -p1 -b .obsolete-macro @@ -265,8 +263,7 @@ for i in `find . -name config.sub`; do perl -pi -e "s/ppc64-\*/ppc64-\* \| ppc64p7-\*/" $i done -CFLAGS="$RPM_OPT_FLAGS $CFLAGS $CPPFLAGS -fPIE"; export CFLAGS -LDFLAGS="$LDFLAGS -pie -Wl,-z,now"; export LDFLAGS +CFLAGS="$RPM_OPT_FLAGS $CFLAGS $CPPFLAGS -fPIC -pie -Wl,-z,relro -Wl,-z,now"; export CFLAGS echo "$CFLAGS" echo "$CPPFLAGS"