after fixing the repo corruption, turn on maximum hardening flags as a bonus level...
authortg <tg@mirbsd.org>
Tue, 7 Feb 2012 22:38:37 +0000 (22:38 +0000)
committertg <tg@mirbsd.org>
Tue, 7 Feb 2012 22:38:37 +0000 (22:38 +0000)
debian/changelog
debian/rules
diff/diff3.c
src/main.c

index e98e49a..1e99fa2 100644 (file)
@@ -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 <tg@mirbsd.de>  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
index b3b7ff4..b08d5a4 100755 (executable)
@@ -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
index e286094..2a58845 100644 (file)
@@ -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);
index 5d09f98..9854832 100644 (file)
@@ -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);
 }