diff -u pchar-1.5/debian/changelog pchar-1.5/debian/changelog --- pchar-1.5/debian/changelog +++ pchar-1.5/debian/changelog @@ -1,3 +1,12 @@ +pchar (1.5-2) unstable; urgency=low + + * Let non-root users know why pchar do not work for them (Closes: + #660946). + * Added new patch hardening.patch to use compile flags from dpkg- + buildflags to enable Hardening. + + -- Petter Reinholdtsen Sat, 12 Oct 2013 14:34:24 +0200 + pchar (1.5-1) unstable; urgency=low * Reupload to Debian based on old package found in diff -u pchar-1.5/debian/patches/series pchar-1.5/debian/patches/series --- pchar-1.5/debian/patches/series +++ pchar-1.5/debian/patches/series @@ -3 +3,3 @@ -destdir-install.patch \ No newline at end of file +destdir-install.patch +root-required.patch +hardening.patch only in patch2: unchanged: --- pchar-1.5.orig/debian/patches/hardening.patch +++ pchar-1.5/debian/patches/hardening.patch @@ -0,0 +1,28 @@ +Index: pchar-1.5/Makefile.in +=================================================================== +--- pchar-1.5.orig/Makefile.in 2013-10-12 14:27:29.417521246 +0200 ++++ pchar-1.5/Makefile.in 2013-10-12 14:29:56.518261059 +0200 +@@ -47,17 +48,22 @@ + # + DFLAGS= @DEFS@ + ++# Debian hardening ++CPPEXTRA:=$(shell dpkg-buildflags --get CPPFLAGS) ++CXXEXTRA:=$(shell dpkg-buildflags --get CXXFLAGS) ++LDEXTRA:=$(shell dpkg-buildflags --get LDFLAGS) ++ + # + # Compilation flags + # +-LDFLAGS=@LDFLAGS@ ++LDFLAGS=@LDFLAGS@ $(LDEXTRA) + LIBS=@LIBS@ + IFLAGS=@CPPFLAGS@ -I$(srcdir) + + # + # Other cc options get defined here. + # +-CXXFLAGS=@CXXFLAGS@ $(IFLAGS) $(DFLAGS) ++CXXFLAGS=@CXXFLAGS@ $(IFLAGS) $(DFLAGS) $(CPPEXTRA) $(CXXEXTRA) + + # only in patch2: unchanged: --- pchar-1.5.orig/debian/patches/root-required.patch +++ pchar-1.5/debian/patches/root-required.patch @@ -0,0 +1,37 @@ +Description: Give more sensible message when running as non-root +Author: Petter Reinholdtsen +Forwarded: no +Last-Update: 2013-10-12 + +Bug-Debian: http://bugs.debian.org/660946 +Forwarded: no +Reviewed-By: Petter Reinholdtsen +Last-Update: 2013-10-12 + +--- pchar-1.5.orig/README ++++ pchar-1.5/README +@@ -12,6 +12,10 @@ + latency, and loss of links along an end-to-end path through the + Internet. pchar works in both IPv4 and IPv6 networks. + ++The pchar program requires root privileges to send the network ++packages. It might be safe to make suid root, but no-one know for ++sure. ++ + As of pchar-1.5, this program is no longer under active development, + and no further releases are planned. + +--- pchar-1.5.orig/main.cc ++++ pchar-1.5/main.cc +@@ -339,6 +339,11 @@ + int c; // getopt + Pctest *pct = NULL; // test structure + ++ if (0 != geteuid()) { ++ fprintf(stderr, "error: the pchar program requries root privilges to work.\n"); ++ return 0; ++ } ++ + // Parse command-line arguments using getopt + while ((c = getopt(argc, argv, "a:b:cCd:g:G:hH:i:I:l:m:M:np:P:qR:r:s:St:T:vVw:")) != -1) { +