compile with PIE and RELRO flags (#853176)

This commit is contained in:
Miroslav Lichvar 2013-01-24 16:00:59 +01:00
parent ce42c7b586
commit b6e4f4a7f7
2 changed files with 26 additions and 1 deletions

View File

@ -0,0 +1,18 @@
diff -up libutempter-1.1.6/Makefile.pierelro libutempter-1.1.6/Makefile
--- libutempter-1.1.6/Makefile.pierelro 2010-11-04 18:14:53.000000000 +0100
+++ libutempter-1.1.6/Makefile 2013-01-24 15:58:06.241865564 +0100
@@ -52,11 +52,12 @@ all: $(TARGETS)
$(COMPILE.c) -fPIC $< $(OUTPUT_OPTION)
$(PROJECT): utempter.c
- $(LINK.c) -Wl,-z,now,-stats $(LDLIBS) $< $(OUTPUT_OPTION)
+ $(LINK.c) -pie -fPIE -Wl,-z,relro,-z,now,-stats $(LDLIBS) \
+ $< $(OUTPUT_OPTION)
$(SHAREDLIB): iface.os $(MAP)
$(LINK.o) -shared \
- -Wl,-soname,$(SONAME),--version-script=$(MAP),-z,defs,-stats \
+ -Wl,-soname,$(SONAME),--version-script=$(MAP),-z,relro,-z,defs,-stats \
-lc $< $(OUTPUT_OPTION)
$(STATICLIB): iface.o

View File

@ -3,13 +3,16 @@
Summary: A privileged helper for utmp/wtmp updates
Name: libutempter
Version: 1.1.6
Release: 1%{?dist}
Release: 2%{?dist}
License: LGPLv2+
Group: System Environment/Libraries
URL: ftp://ftp.altlinux.org/pub/people/ldv/utempter
Source0: ftp://ftp.altlinux.org/pub/people/ldv/utempter/%{name}-%{version}.tar.bz2
# Compile with PIE and RELRO flags.
Patch0: libutempter-pierelro.patch
Requires(pre): shadow-utils
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
@ -31,6 +34,7 @@ utempter-based software.
%prep
%setup -q
%patch0 -p1 -b .pierelro
%build
make CFLAGS="$RPM_OPT_FLAGS" libdir="%{_libdir}" libexecdir="%{_libexecdir}"
@ -73,6 +77,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
%{_mandir}/man3/*
%changelog
* Thu Jan 24 2013 Miroslav Lichvar <mlichvar@redhat.com> - 1.1.6-2
- compile with PIE and RELRO flags (#853176)
* Thu Oct 11 2012 Miroslav Lichvar <mlichvar@redhat.com> - 1.1.6-1
- update to 1.1.6
- fix license tag