Package: logrotate
Version: 3.8.1-1
Severity: important
Tags: patch

Please enable hardened build flags through dpkg-buildflags.

Patch attached. 

The enforced format string check bail out with the local version 
of asprintf, though. I'm not sure why, but since it's only used 
for HPUX patching it out should work fine.

Cheers,
        Moritz
diff -aur logrotate-3.8.1.orig/Makefile logrotate-3.8.1/Makefile
--- logrotate-3.8.1.orig/Makefile	2011-12-30 17:25:49.000000000 +0100
+++ logrotate-3.8.1/Makefile	2011-12-30 17:32:05.000000000 +0100
@@ -1,7 +1,10 @@
 VERSION = $(shell awk '/Version:/ { print $$2 }' logrotate.spec)
 OS_NAME = $(shell uname -s)
 LFS = $(shell echo `getconf LFS_CFLAGS 2>/dev/null`)
-CFLAGS = -Wall -D_GNU_SOURCE -D$(OS_NAME) -DVERSION=\"$(VERSION)\" $(RPM_OPT_FLAGS) $(LFS)
+CFLAGS = $(shell dpkg-buildflags --get CFLAGS)
+CFLAGS += -Wall -D_GNU_SOURCE -D$(OS_NAME) -DVERSION=\"$(VERSION)\" $(RPM_OPT_FLAGS) $(LFS)
+EXTRA_LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
+EXTRA_CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
 PROG = logrotate
 MAN = logrotate.8
 MAN5 = logrotate.conf.5

Reply via email to