Browse Source

Enable hardening build flags. Closes: #656650

Christoph Biedl 10 years ago
parent
commit
6670d2aaff
4 changed files with 10 additions and 4 deletions
  1. 2 1
      Makefile.am
  2. 1 1
      debian/control
  3. 5 0
      debian/rules
  4. 2 2
      plugins/Makefile

+ 2 - 1
Makefile.am

@@ -11,9 +11,10 @@ INCLUDES = -I.
 ##  warning with -Wmissing-prototypes).
 ## -Wmissing-prototypes removed (eg, Linux 2.2.6 headers
 ##  aren't up to it).
-CFLAGS = -O2 -fno-builtin -Wall -DSBINDIR='"$(sbindir)"'
+#CFLAGS = -O2 -fno-builtin -Wall -DSBINDIR='"$(sbindir)"'
 #CFLAGS = -O2 -fno-builtin -Wall -ansi -DSBINDIR='"$(sbindir)"'
 #CFLAGS = -O2 -fno-builtin -Wall -ansi -pedantic -Wmissing-prototypes -Werror -DSBINDIR='"$(sbindir)"'
+CPPFLAGS = -DSBINDIR='"$(sbindir)"'
 
 man_MANS = pptpctrl.8 pptpd.8 pptpd.conf.5
 

+ 1 - 1
debian/control

@@ -3,7 +3,7 @@ Section: net
 Priority: optional
 Maintainer: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
 Standards-Version: 3.9.1
-Build-Depends: libwrap0-dev, debhelper (>= 4.1.16), ppp-dev (>=2.4.5-3)
+Build-Depends: libwrap0-dev, debhelper (>= 4.1.16), ppp-dev (>=2.4.5-3), automake, hardening-wrapper
 
 Package: pptpd
 Architecture: any

+ 5 - 0
debian/rules

@@ -3,6 +3,10 @@
 # Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
 # Some lines taken from debmake, by Cristoph Lameter.
 
+export DEB_BUILD_HARDENING=1
+export CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
+export LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
+
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
@@ -12,6 +16,7 @@ build: build-stamp
 build-stamp:
 	dh_testdir
 
+	autoreconf
 	./configure --prefix=/usr --mandir=/usr/share/man \
 		    --with-libwrap --enable-bcrelay
 	# Add here commands to compile the package.

+ 2 - 2
plugins/Makefile

@@ -1,7 +1,7 @@
 CC	= gcc
 COPTS	= -O2 -g
-CFLAGS	= $(COPTS) -I.. -I../../include -fPIC
-LDFLAGS	= -shared
+CFLAGS  += $(COPTS) -I.. -I../../include -fPIC
+LDFLAGS += -shared
 LDADD   = -lutil
 INSTALL	= install -o root
 prefix  = /usr/local