From 0e14c2a9a891a91d6a62dfd97455b12aec93f5ce Mon Sep 17 00:00:00 2001 From: "Jan F. Chadima" Date: Wed, 10 Aug 2011 04:21:03 +0200 Subject: [PATCH] Add partial relro support for libraries --- cyrus-sasl-2.1.23-relro.patch | 25 +++++++++++++++++++++++++ cyrus-sasl.spec | 7 ++++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 cyrus-sasl-2.1.23-relro.patch diff --git a/cyrus-sasl-2.1.23-relro.patch b/cyrus-sasl-2.1.23-relro.patch new file mode 100644 index 0000000..411e930 --- /dev/null +++ b/cyrus-sasl-2.1.23-relro.patch @@ -0,0 +1,25 @@ +diff -up cyrus-sasl-2.1.23/lib/Makefile.am.relro cyrus-sasl-2.1.23/lib/Makefile.am +--- cyrus-sasl-2.1.23/lib/Makefile.am.relro 2009-04-28 17:09:15.000000000 +0200 ++++ cyrus-sasl-2.1.23/lib/Makefile.am 2011-08-10 03:53:47.994891976 +0200 +@@ -60,7 +60,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.23/plugins/Makefile.am.relro cyrus-sasl-2.1.23/plugins/Makefile.am +--- cyrus-sasl-2.1.23/plugins/Makefile.am.relro 2011-08-10 04:01:39.725891950 +0200 ++++ cyrus-sasl-2.1.23/plugins/Makefile.am 2011-08-10 04:02:47.674892053 +0200 +@@ -62,7 +62,7 @@ ldapdb_version = 2:23:0 + srp_version = 2:23: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) ++AM_LDFLAGS = -Wl,-z,relro -module -export-dynamic -rpath $(plugindir) + + COMPAT_OBJS = @LTGETADDRINFOOBJS@ @LTGETNAMEINFOOBJS@ @LTSNPRINTFOBJS@ + +diff -up cyrus-sasl-2.1.23/sasldb/Makefile.am.relro cyrus-sasl-2.1.23/sasldb/Makefile.am diff --git a/cyrus-sasl.spec b/cyrus-sasl.spec index 53c97be..8520548 100644 --- a/cyrus-sasl.spec +++ b/cyrus-sasl.spec @@ -8,7 +8,7 @@ Summary: The Cyrus SASL library Name: cyrus-sasl Version: 2.1.23 -Release: 25%{?dist} +Release: 26%{?dist} License: BSD with advertising Group: System Environment/Libraries # Source0 originally comes from ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/; @@ -44,6 +44,7 @@ Patch38: cyrus-sasl-2.1.23-pam_rhosts.patch Patch39: cyrus-sasl-2.1.23-ntlm.patch Patch40: cyrus-sasl-2.1.23-rimap2.patch Patch41: cyrus-sasl-2.1.23-db5.patch +Patch42: cyrus-sasl-2.1.23-relro.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: autoconf, automake, libtool, gdbm-devel, groff @@ -180,6 +181,7 @@ chmod -x include/*.h %patch39 -p1 -b .ntlm %patch40 -p1 -b .rimap2 %patch41 -p1 -b .db5 +%patch42 -p1 -b .relro %build # FIXME - we remove these files directly so that we can avoid using the -f @@ -432,6 +434,9 @@ exit 0 /etc/rc.d/init.d/saslauthd %changelog +* Wed Aug 10 2011 Jan F. Chadima - 2.1.23-26 +- Add partial relro support for libraries + * Mon Jul 25 2011 Jan F. Chadima - 2.1.23-25 - Add support for berkeley db 5