summaryrefslogtreecommitdiff
path: root/debian/patches/use-dpkg-buildflags.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/use-dpkg-buildflags.patch')
-rw-r--r--debian/patches/use-dpkg-buildflags.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/debian/patches/use-dpkg-buildflags.patch b/debian/patches/use-dpkg-buildflags.patch
new file mode 100644
index 0000000..e1a7e46
--- /dev/null
+++ b/debian/patches/use-dpkg-buildflags.patch
@@ -0,0 +1,39 @@
+Description: Use build flags from environment for plugins (dpkg-buildflags).
+ Necessary for hardening flags.
+Author: Simon Ruderich <simon@ruderich.org>
+Last-Update: 2012-03-16
+
+--- openvpn-2.2.1.orig/src/plugins/auth-pam/Makefile
++++ openvpn-2.2.1/src/plugins/auth-pam/Makefile
+@@ -18,13 +18,13 @@ INCLUDE=-I../..
+ CC_FLAGS=-O2 -Wall -DDLOPEN_PAM=$(DLOPEN_PAM)
+
+ openvpn-auth-pam.so : auth-pam.o pamdl.o
+- gcc ${CC_FLAGS} -fPIC -shared -Wl,-soname,openvpn-auth-pam.so -o openvpn-auth-pam.so auth-pam.o pamdl.o -lc $(LIBPAM)
++ gcc ${CFLAGS} ${CC_FLAGS} ${LDFLAGS} -fPIC -shared -Wl,-soname,openvpn-auth-pam.so -o openvpn-auth-pam.so auth-pam.o pamdl.o -lc $(LIBPAM)
+
+ auth-pam.o : auth-pam.c pamdl.h
+- gcc ${CC_FLAGS} -fPIC -c ${INCLUDE} auth-pam.c
++ gcc ${CFLAGS} ${CC_FLAGS} ${CPPFLAGS} -fPIC -c ${INCLUDE} auth-pam.c
+
+ pamdl.o : pamdl.c pamdl.h
+- gcc ${CC_FLAGS} -fPIC -c ${INCLUDE} pamdl.c
++ gcc ${CFLAGS} ${CC_FLAGS} ${CPPFLAGS} -fPIC -c ${INCLUDE} pamdl.c
+
+ clean :
+ rm -f *.o *.so
+--- openvpn-2.2.1.orig/src/plugins/down-root/Makefile
++++ openvpn-2.2.1/src/plugins/down-root/Makefile
+@@ -8,10 +8,10 @@ INCLUDE=-I../..
+ CC_FLAGS=-O2 -Wall
+
+ down-root.so : down-root.o
+- gcc ${CC_FLAGS} -fPIC -shared -Wl,-soname,openvpn-down-root.so -o openvpn-down-root.so down-root.o -lc
++ gcc ${CFLAGS} ${CC_FLAGS} ${LDFLAGS} -fPIC -shared -Wl,-soname,openvpn-down-root.so -o openvpn-down-root.so down-root.o -lc
+
+ down-root.o : down-root.c
+- gcc ${CC_FLAGS} -fPIC -c ${INCLUDE} down-root.c
++ gcc ${CFLAGS} ${CC_FLAGS} ${CPPFLAGS} -fPIC -c ${INCLUDE} down-root.c
+
+ clean :
+ rm -f *.o *.so