dhcp/dhcp-4.2.2-PIE-RELRO.patch

92 lines
4.4 KiB
Diff
Raw Normal View History

2011-07-01 12:42:18 +00:00
diff -up dhcp-4.2.2b1/bind/Makefile.PIE-RELRO dhcp-4.2.2b1/bind/Makefile
--- dhcp-4.2.2b1/bind/Makefile.PIE-RELRO 2011-06-27 23:43:09.000000000 +0200
+++ dhcp-4.2.2b1/bind/Makefile 2011-07-01 14:28:49.134674155 +0200
@@ -45,7 +45,7 @@ all:
# Currently disable the epoll and devpoll options as they don't interact
# well with the DHCP code.
@echo Configuring BIND Export libraries for DHCP.
2011-07-01 12:42:18 +00:00
- @(cd ${bindsrcdir} && ./configure --disable-kqueue --disable-epoll --disable-devpoll --without-openssl --without-libxml2 --enable-exportlib --enable-threads=no --with-export-includedir=${binddir}/include --with-export-libdir=${binddir}/lib --with-gssapi=no > ${binddir}/configure.log)
+ @(cd ${bindsrcdir} && ./configure --disable-kqueue --disable-epoll --disable-devpoll --without-openssl --without-libxml2 --enable-exportlib --enable-threads=no --with-export-includedir=${binddir}/include --with-export-libdir=${binddir}/lib --with-gssapi=no --with-libtool --with-pic --disable-shared > ${binddir}/configure.log)
# Build the export libraries
@echo Building BIND Export libraries - this takes some time.
2011-07-01 12:42:18 +00:00
diff -up dhcp-4.2.2b1/client/Makefile.am.PIE-RELRO dhcp-4.2.2b1/client/Makefile.am
--- dhcp-4.2.2b1/client/Makefile.am.PIE-RELRO 2011-07-01 14:26:36.995286194 +0200
+++ dhcp-4.2.2b1/client/Makefile.am 2011-07-01 14:26:37.047285196 +0200
@@ -4,15 +4,11 @@ dhclient_SOURCES = clparse.c dhclient.c
scripts/bsdos scripts/freebsd scripts/linux scripts/macos \
scripts/netbsd scripts/nextstep scripts/openbsd \
scripts/solaris scripts/openwrt
+dhclient_CPPFLAGS = -DCLIENT_PATH='"$(sbindir)"' -DLOCALSTATEDIR='"$(localstatedir)"'
+dhclient_CFLAGS = -fpie
dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \
$(BIND9_LIBDIR) -ldns-export -lisc-export $(CAPNG_LDADD)
+dhclient_LDFLAGS = -pie -Wl,-z,relro -Wl,-z,now
+
man_MANS = dhclient.8 dhclient-script.8 dhclient.conf.5 dhclient.leases.5
EXTRA_DIST = $(man_MANS)
-
-dhclient.o: dhclient.c
- $(COMPILE) -DCLIENT_PATH='"PATH=$(sbindir):/sbin:/bin:/usr/sbin:/usr/bin"' \
- -DLOCALSTATEDIR='"$(localstatedir)"' -c dhclient.c
-
-dhc6.o: dhc6.c
- $(COMPILE) -DCLIENT_PATH='"PATH=$(sbindir):/sbin:/bin:/usr/sbin:/usr/bin"' \
- -DLOCALSTATEDIR='"$(localstatedir)"' -c dhc6.c
2011-07-01 12:42:18 +00:00
diff -up dhcp-4.2.2b1/common/Makefile.am.PIE-RELRO dhcp-4.2.2b1/common/Makefile.am
--- dhcp-4.2.2b1/common/Makefile.am.PIE-RELRO 2011-02-18 19:44:42.000000000 +0100
+++ dhcp-4.2.2b1/common/Makefile.am 2011-07-01 14:26:37.048285177 +0200
2011-02-23 11:05:20 +00:00
@@ -1,5 +1,5 @@
AM_CPPFLAGS = -I.. -DLOCALSTATEDIR='"@localstatedir@"'
2011-02-23 11:05:20 +00:00
-AM_CFLAGS = $(LDAP_CFLAGS)
+AM_CFLAGS = $(LDAP_CFLAGS) -fpic
noinst_LIBRARIES = libdhcp.a
libdhcp_a_SOURCES = alloc.c bpf.c comapi.c conflex.c ctrace.c discover.c \
2011-07-01 12:42:18 +00:00
diff -up dhcp-4.2.2b1/omapip/Makefile.am.PIE-RELRO dhcp-4.2.2b1/omapip/Makefile.am
--- dhcp-4.2.2b1/omapip/Makefile.am.PIE-RELRO 2011-07-01 14:26:36.884288319 +0200
+++ dhcp-4.2.2b1/omapip/Makefile.am 2011-07-01 14:26:37.048285177 +0200
@@ -1,3 +1,5 @@
+AM_CFLAGS = -fpic
+
lib_LIBRARIES = libomapi.a
noinst_PROGRAMS = svtest
@@ -10,5 +12,6 @@ man_MANS = omapi.3
EXTRA_DIST = $(man_MANS)
svtest_SOURCES = test.c
+svtest_CFLAGS = -fpie
svtest_LDADD = libomapi.a $(BIND9_LIBDIR) -ldns-export -lisc-export
2011-07-01 12:42:18 +00:00
diff -up dhcp-4.2.2b1/relay/Makefile.am.PIE-RELRO dhcp-4.2.2b1/relay/Makefile.am
--- dhcp-4.2.2b1/relay/Makefile.am.PIE-RELRO 2011-07-01 14:26:36.884288319 +0200
+++ dhcp-4.2.2b1/relay/Makefile.am 2011-07-01 14:26:37.049285158 +0200
@@ -2,8 +2,11 @@ AM_CPPFLAGS = -DLOCALSTATEDIR='"@localst
sbin_PROGRAMS = dhcrelay
dhcrelay_SOURCES = dhcrelay.c
+dhcrelay_CFLAGS = -fpie
dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \
$(BIND9_LIBDIR) -ldns-export -lisc-export
+dhcrelay_LDFLAGS = -pie -Wl,-z,relro -Wl,-z,now
+
man_MANS = dhcrelay.8
EXTRA_DIST = $(man_MANS)
2011-07-01 12:42:18 +00:00
diff -up dhcp-4.2.2b1/server/Makefile.am.PIE-RELRO dhcp-4.2.2b1/server/Makefile.am
--- dhcp-4.2.2b1/server/Makefile.am.PIE-RELRO 2011-07-01 14:26:36.885288300 +0200
+++ dhcp-4.2.2b1/server/Makefile.am 2011-07-01 14:26:37.049285158 +0200
@@ -6,9 +6,10 @@ dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c c
omapi.c mdb.c stables.c salloc.c ddns.c dhcpleasequery.c \
dhcpv6.c mdb6.c ldap.c ldap_casa.c
-dhcpd_CFLAGS = $(LDAP_CFLAGS)
+dhcpd_CFLAGS = $(LDAP_CFLAGS) -fpie
dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \
../dhcpctl/libdhcpctl.a $(BIND9_LIBDIR) -ldns-export -lisc-export
+dhcpd_LDFLAGS = -pie -Wl,-z,relro -Wl,-z,now
man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5
EXTRA_DIST = $(man_MANS)