From b862fa51203d000a0db962ddea3136faca71ea4a Mon Sep 17 00:00:00 2001 From: tg Date: Tue, 7 Feb 2012 22:38:37 +0000 Subject: [PATCH] =?utf8?q?after=20fixing=20the=20repo=20corruption,=20turn?= =?utf8?q?=20on=20maximum=20hardening=20flags=20as=20a=20bonus=20level;=20?= =?utf8?q?this=20fully=20PASSes=20the=20testsuite=20(that=E2=80=99s=20why?= =?utf8?q?=20it=20took=20so=20long=20to=20commit)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- debian/changelog | 9 ++++++++ debian/rules | 63 ++++++++++++++++++++++++++------------------------------ diff/diff3.c | 3 +-- src/main.c | 2 +- 4 files changed, 40 insertions(+), 37 deletions(-) diff --git a/debian/changelog b/debian/changelog index e98e49a..1e99fa2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +cvs (2:1.12.13+real-8) unstable; urgency=high + + * Brown paper bag change: sanity.sh (the testsuite) was corrupted + during checkout of the packaging VCS in the -7 (all PASS again) + * Bonus change: use hardening build flags; fix resulting warnings + * Urgency due to riding on the previous upload’s security fix + + -- Thorsten Glaser Tue, 07 Feb 2012 20:39:42 +0000 + cvs (2:1.12.13+real-7) unstable; urgency=high * Drop unsafe scripts from contrib, add NEWS entry for that diff --git a/debian/rules b/debian/rules index b3b7ff4..b08d5a4 100755 --- a/debian/rules +++ b/debian/rules @@ -1,37 +1,37 @@ #!/usr/bin/make -f -# $MirOS: contrib/hosted/tg/deb/cvs/debian/rules,v 1.16 2011/12/04 15:18:36 tg Exp $ -#- -# -*- makefile -*- -# Sample debian/rules that uses debhelper. -# This file was originally written by Joey Hess and Craig Small. -# As a special exception, when this file is copied by dh-make into a -# dh-make output file, you may use that output file without restriction. -# This special exception was added by Craig Small in version 0.37 of dh-make. - -SHELL?= sh -CC?= gcc -CFLAGS= -Wall -g - -ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) -CFLAGS+= -O0 +# $MirOS: contrib/hosted/tg/deb/cvs/debian/rules,v 1.17 2012/02/07 22:38:36 tg Exp $ + +CC?= gcc +CONFIGURE_ENV:= CC='${CC}' +EXTRA_CFLAGS= -Wall -fno-strict-aliasing -Wformat +# for now. uses are mostly checked. +EXTRA_CFLAGS+= -Wno-unused-result +EXTRA_CPPFLAGS= -D_GNU_SOURCE -DUSE_LIBBSD + +ifneq (,$(wildcard /usr/share/dpkg/buildflags.mk)) +# dpkg-dev (>= 1.16.1~) +DEB_CFLAGS_MAINT_APPEND=${EXTRA_CFLAGS} +DEB_CPPFLAGS_MAINT_APPEND=${EXTRA_CPPFLAGS} +DEB_BUILD_MAINT_OPTIONS=hardening=+all +DPKG_EXPORT_BUILDFLAGS= Yes +include /usr/share/dpkg/buildflags.mk else -CFLAGS+= -O2 +# old-fashioned way to determine build flags +CFLAGS= -O$(if $(findstring noopt,${DEB_BUILD_OPTIONS}),0,2) -g +CFLAGS+= ${EXTRA_CFLAGS} +CPPFLAGS+= ${EXTRA_CPPFLAGS} +CONFIGURE_ENV+= CFLAGS='${CFLAGS}' +CONFIGURE_ENV+= CPPFLAGS='${CPPFLAGS}' +CONFIGURE_ENV+= LDFLAGS='${LDFLAGS}' endif ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) -NUMJOBS= $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) -MAKEFLAGS+= -j${NUMJOBS} +NUMJOBS= $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) +MAKEFLAGS+= -j${NUMJOBS} endif -CPPFLAGS+= -D_GNU_SOURCE -CFLAGS+= -fno-strict-aliasing -Wformat +LIBS+= -lbsd -CPPFLAGS+= -DUSE_LIBBSD -LIBS+= -lbsd - -CONFIGURE_ENV:= CC='${CC}' -CONFIGURE_ENV+= CFLAGS='${CFLAGS}' -CONFIGURE_ENV+= CPPFLAGS='${CPPFLAGS}' CONFIGURE_ENV+= LIBS='${LIBS}' CONFIGURE_ENV+= CSH=/bin/csh @@ -98,7 +98,9 @@ clean: -rm -rf ${CLEANFILES} dh_clean -debian/.install_stamp: debian/.build_stamp +binary-indep: + +binary-arch: debian/.build_stamp dh_testdir dh_testroot if test -x "$$(which dh_prep)"; then dh_prep; else dh_clean -k; fi @@ -130,13 +132,6 @@ debian/.install_stamp: debian/.build_stamp rm -f debian/stagedir/usr/share/cvs/contrib/rcslock # we ship cvs-switchroot(1) instead rm -f debian/stagedir/usr/share/cvs/contrib/newcvsroot - @:>$@ - -binary-indep: - -binary-arch: build debian/.install_stamp - dh_testdir - dh_testroot dh_installchangelogs debian/stagedir/clogs/ChangeLog dh_installdocs dh_install diff --git a/diff/diff3.c b/diff/diff3.c index e286094..2a58845 100644 --- a/diff/diff3.c +++ b/diff/diff3.c @@ -1446,7 +1446,6 @@ output_diff3 (diff, mapping, rev_mapping) size_t length; int dontprint = 0; static int skew_increment[3] = { 2, 3, 1 }; /* 0==>2==>1==>3 */ - char const *line_prefix = tab_align_flag ? "\t" : " "; for (ptr = diff; ptr; ptr = D_NEXT (ptr)) { @@ -1503,7 +1502,7 @@ output_diff3 (diff, mapping, rev_mapping) line = 0; do { - printf_output (line_prefix); + printf_output (tab_align_flag ? "\t" : " "); cp = D_RELNUM (ptr, realfile, line); length = D_RELLEN (ptr, realfile, line); write_output (cp, length); diff --git a/src/main.c b/src/main.c index 5d09f98..9854832 100644 --- a/src/main.c +++ b/src/main.c @@ -1402,7 +1402,7 @@ usage (register const char *const *cpp) { (void) fprintf (stderr, *cpp++, program_name, cvs_cmd_name); for (; *cpp; cpp++) - (void) fprintf (stderr, *cpp); + (void) fprintf (stderr, "%s", *cpp); exit (EXIT_FAILURE); } -- 2.1.4