diff -Nru ipband-0.8.1/debian/changelog ipband-0.8.1/debian/changelog --- ipband-0.8.1/debian/changelog 2011-04-30 19:24:23.000000000 +0000 +++ ipband-0.8.1/debian/changelog 2011-03-22 16:18:05.000000000 +0000 @@ -1,3 +1,26 @@ +ipband (0.8.1-3) unstable; urgency=low + + * New maintainer. (Closes: #553356) + * Standards version 3.9.1: + + Compatibility level 8. + + Build-depends: debhelper (>= 8). + * Migration to format "3.0 (quilt)". + * debian/rules: Trivial content using "dh". + + debian/ipband.examples: New file. + * debian/postrm: maintainer-script-without-set-e + * Binary package: dir-or-file-in-var-run + + debian/ipband.dirs: Removed. + * [lintian]: Spelling error. + + debian/patches/02_manpage_spelling_errors.diff: New file. + * Compiler warnings: + + debian/patches/03_compiler_warnings.diff: New file. + * Strengthen string checking to prevent a crash: + + debian/patches/04_check_mailer_strings.diff: New file. + * debian/watch: Let URL end in a dash. + * debian/copyright: Restore a verbatim quotation. + + -- Mats Erik Andersson Tue, 22 Mar 2011 17:18:00 +0100 + ipband (0.8.1-2) unstable; urgency=low * [f5fb74a] Orphaning package diff -Nru ipband-0.8.1/debian/compat ipband-0.8.1/debian/compat --- ipband-0.8.1/debian/compat 2011-04-30 19:24:23.000000000 +0000 +++ ipband-0.8.1/debian/compat 2011-03-22 15:04:05.000000000 +0000 @@ -1 +1 @@ -5 +8 diff -Nru ipband-0.8.1/debian/control ipband-0.8.1/debian/control --- ipband-0.8.1/debian/control 2011-04-30 19:24:23.000000000 +0000 +++ ipband-0.8.1/debian/control 2011-03-22 15:04:22.000000000 +0000 @@ -1,9 +1,9 @@ Source: ipband Section: net Priority: optional -Maintainer: Debian QA Group -Build-Depends: debhelper (>> 6), libpcap-dev, dpatch -Standards-Version: 3.8.3 +Maintainer: Mats Erik Andersson +Build-Depends: debhelper (>= 8), libpcap-dev +Standards-Version: 3.9.1 Homepage: http://ipband.sourceforge.net/ Package: ipband diff -Nru ipband-0.8.1/debian/copyright ipband-0.8.1/debian/copyright --- ipband-0.8.1/debian/copyright 2011-04-30 19:24:23.000000000 +0000 +++ ipband-0.8.1/debian/copyright 2010-10-21 14:50:37.000000000 +0000 @@ -9,10 +9,10 @@ Copyright © 2001, 2002 by Andrew Nevynniy - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2, as - published by the Free Software Foundation. See the file - /usr/share/common-licenses/GPL for details. + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff -Nru ipband-0.8.1/debian/ipband.dirs ipband-0.8.1/debian/ipband.dirs --- ipband-0.8.1/debian/ipband.dirs 2011-04-30 19:24:23.000000000 +0000 +++ ipband-0.8.1/debian/ipband.dirs 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -/var/run/ipband/ diff -Nru ipband-0.8.1/debian/ipband.examples ipband-0.8.1/debian/ipband.examples --- ipband-0.8.1/debian/ipband.examples 1970-01-01 00:00:00.000000000 +0000 +++ ipband-0.8.1/debian/ipband.examples 2010-10-21 14:31:44.000000000 +0000 @@ -0,0 +1,2 @@ +debian/ipband.conf-simple +debian/ipband.conf-verbose diff -Nru ipband-0.8.1/debian/ipband.init ipband-0.8.1/debian/ipband.init --- ipband-0.8.1/debian/ipband.init 2011-04-30 19:24:23.000000000 +0000 +++ ipband-0.8.1/debian/ipband.init 2011-03-22 16:04:23.000000000 +0000 @@ -14,6 +14,7 @@ DAEMON=/usr/sbin/ipband NAME=ipband DESC=ipband +PIDDIR=/var/run/ipband set -e @@ -29,15 +30,15 @@ case "$1" in start) printf "Starting $DESC:" + mkdir -p $PIDDIR for config_file in $CONFIG_FILES; do if [ ! -r "$config_file" ]; then [ "$CONFIG" = "true" ] || CONFIG="false" else CONFIG="true" IDENTIFIER="$(printf "$config_file" | tr / _)" - mkdir -p /var/run/ipband start-stop-daemon --start --background --make-pidfile \ - --quiet --pidfile "/var/run/ipband/$IDENTIFIER.pid" \ + --quiet --pidfile "$PIDDIR/$IDENTIFIER.pid" \ --exec $DAEMON -- $FLAGS -c "$config_file" printf " $config_file" fi @@ -47,10 +48,12 @@ ;; stop) printf "Stopping $DESC: " - for pid_file in /var/run/ipband/*.pid; do + for pid_file in $PIDDIR/*.pid; do if [ ! -f "$pid_file" ]; then continue; fi start-stop-daemon --oknodo --stop --quiet --pidfile "$pid_file" \ - --exec $DAEMON -- $FLAGS + --exec $DAEMON -- $FLAGS && \ + rm -f $pid_file + done printf "$NAME.\n" ;; @@ -58,6 +61,16 @@ $0 stop || true $0 start ;; + status) + count=$(ls -1 $PIDDIR/*.pid 2>/dev/null | wc -l) + if [ $count -gt 0 ]; then + echo -n "ipband is running $count configuration" + [ $count -eq 1 ] || echo -n "s" + echo "." + else + echo "Ipband is not running." + fi + ;; *) N=/etc/init.d/$NAME echo "Usage: $N {start|stop|restart|force-reload}" >&2 diff -Nru ipband-0.8.1/debian/ipband.postrm ipband-0.8.1/debian/ipband.postrm --- ipband-0.8.1/debian/ipband.postrm 2011-04-30 19:24:23.000000000 +0000 +++ ipband-0.8.1/debian/ipband.postrm 2010-10-21 13:08:52.000000000 +0000 @@ -1,4 +1,6 @@ -#!/bin/sh -e +#!/bin/sh + +set -e #DEBHELPER# diff -Nru ipband-0.8.1/debian/patches/00list ipband-0.8.1/debian/patches/00list --- ipband-0.8.1/debian/patches/00list 2011-04-30 19:24:23.000000000 +0000 +++ ipband-0.8.1/debian/patches/00list 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -01_fix_makefile.dpatch diff -Nru ipband-0.8.1/debian/patches/02_manpage_spelling_errors.diff ipband-0.8.1/debian/patches/02_manpage_spelling_errors.diff --- ipband-0.8.1/debian/patches/02_manpage_spelling_errors.diff 1970-01-01 00:00:00.000000000 +0000 +++ ipband-0.8.1/debian/patches/02_manpage_spelling_errors.diff 2011-03-22 13:27:36.000000000 +0000 @@ -0,0 +1,15 @@ +Description: Trivial spelling mistake. +Author: Mats Erik Andersson +Forwarded: yes +Last-Update: 2010-10-21 +--- ipband-0.8.1.debian/ipband.8 ++++ ipband-0.8.1/ipband.8 +@@ -15,7 +15,7 @@ + + It also can be used to monitor internet connection when specifying the range of local ip addresses (to avoid firing reports about non\-local networks). + +-Bandwidth is defined as total size in kBytes of the layer 2 frames with IP packets passing the specified interface during the avaraging period devided by the number of seconds in that period. ++Bandwidth is defined as total size in kBytes of the layer 2 frames with IP packets passing the specified interface during the averaging period divided by the number of seconds in that period. + .SH "COMMAND LINE OPTIONS" + .TP + .B interface diff -Nru ipband-0.8.1/debian/patches/03_compiler_warnings.diff ipband-0.8.1/debian/patches/03_compiler_warnings.diff --- ipband-0.8.1/debian/patches/03_compiler_warnings.diff 1970-01-01 00:00:00.000000000 +0000 +++ ipband-0.8.1/debian/patches/03_compiler_warnings.diff 2010-10-21 19:51:13.000000000 +0000 @@ -0,0 +1,101 @@ +Description: Various compiler warnings. + Castings are used to account for bad type choices. +Author: Mats Erik Andersson +Forwarded: yes +Last-Update: 2010-10-21 +diff -Naup ipband-0.8.1.debian/init.c ipband-0.8.1/init.c +--- ipband-0.8.1.debian/init.c ++++ ipband-0.8.1/init.c +@@ -402,7 +402,7 @@ void preload_subnets(char *str, hlist_t + /* Apply mask */ + netip &= mask_m; + +- sprintf(key,"%08x",netip); ++ sprintf((char *) key,"%08x",netip); + + /* Set bandwidth threshold for this net */ + idata.band = bwidth; +diff -Naup ipband-0.8.1.debian/packets.c ipband-0.8.1/packets.c +--- ipband-0.8.1.debian/packets.c ++++ ipband-0.8.1/packets.c +@@ -58,8 +58,8 @@ void storepkt (struct pcap_pkthdr *pkthd + /* Apply mask and get our key - network number */ + ip_src &= mask_m; + ip_dst &= mask_m; +- sprintf(key_src,"%08x",ip_src); +- sprintf(key_dst,"%08x",ip_dst); ++ sprintf((char *) key_src,"%08x",ip_src); ++ sprintf((char *) key_dst,"%08x",ip_dst); + + /* Store length of this packet */ + idata.nbyte = (double) length; +@@ -299,7 +299,7 @@ void proc_aggr (hlist_t **ha, hlist_t ** + } + + if (do_html) { +- html_report(" %s ", hex2dot(t->key)); ++ html_report(" %s ", hex2dot((char *) t->key)); + html_report("%.2f kBps\n",kBps); + } + +@@ -309,7 +309,7 @@ void proc_aggr (hlist_t **ha, hlist_t ** + fprintf (outfile_m, "*"); + else + fprintf (outfile_m, " "); +- fprintf (outfile_m, "%-15s", hex2dot(t->key)); ++ fprintf (outfile_m, "%-15s", hex2dot((char *) t->key)); + fprintf (outfile_m, " %7.2f kB ",kbytes); + fprintf (outfile_m, " %7.2f/%6.2f kBps",kBps,thresh); + fprintf (outfile_m, "\n"); +@@ -371,7 +371,7 @@ void detail_cleanup (hlist_t **ha_d, U_C + ntable = 1 << nhashbit; + + /* Get subnet number in int */ +- sscanf(key,"%08x",&ip_key); ++ sscanf((char *) key,"%08x",&ip_key); + + /* Walk table */ + for (hash = 0; hash < ntable; hash++) { +diff -Naup ipband-0.8.1.debian/reports.c ipband-0.8.1/reports.c +--- ipband-0.8.1.debian/reports.c ++++ ipband-0.8.1/reports.c +@@ -52,17 +52,17 @@ void subnet_report (hlist_t **ha_d, U_CH + qsort(conn,nconn,sizeof(hlist_t *),compare_bytes); + + /* Get network name if available */ +- sscanf(key,"%08x",&ikey); ++ sscanf((char *) key,"%08x",&ikey); + net_s = getnetbyaddr(ikey,AF_INET); + + /* Print e-mail subject to include subnet info */ +- if(net_s) va_report("Subject: Bandwidth report for %s <%s>\n\n",hex2dot(key),net_s->n_name); +- else va_report("Subject: Bandwidth report for %s\n\n",hex2dot(key)); ++ if(net_s) va_report("Subject: Bandwidth report for %s <%s>\n\n",hex2dot((char *) key),net_s->n_name); ++ else va_report("Subject: Bandwidth report for %s\n\n",hex2dot((char *) key)); + + /* Print header */ + va_report("\nDate: %s", ctime(&now)); + if(top_m) va_report("Showing top %d connections\n",top_m); +- va_report("Network: %s", hex2dot(key)); ++ va_report("Network: %s", hex2dot((char *) key)); + if(net_s) va_report(" <%s>",net_s->n_name); + va_report("\n"); + va_report("Bandwidth threshold: %.2f kBps, exceeded for: %.2f min\n",thresh,(float) exc_time/60.0); +@@ -104,7 +104,7 @@ void subnet_report (hlist_t **ha_d, U_CH + /* Skiping subnets other than our */ + ip_src = data->subnet_src; + ip_dst = data->subnet_dst; +- sscanf(key,"%08x",&ip_key); ++ sscanf((char *) key,"%08x",&ip_key); + if ( !(ip_src == ip_key || ip_dst == ip_key) ) continue; + + /* Inreasing loop counter only after other subnets are +@@ -171,7 +171,7 @@ char *get_service(int port, int prot) { + + ll_srvc_t *p; + char *srvcs; +- char *prots; ++ char *prots = NULL; + + struct servent *srvc_s; + struct protoent *prot_s; diff -Nru ipband-0.8.1/debian/patches/04_check_mailer_strings.diff ipband-0.8.1/debian/patches/04_check_mailer_strings.diff --- ipband-0.8.1/debian/patches/04_check_mailer_strings.diff 1970-01-01 00:00:00.000000000 +0000 +++ ipband-0.8.1/debian/patches/04_check_mailer_strings.diff 2011-03-22 16:16:10.000000000 +0000 @@ -0,0 +1,84 @@ +Description: Detection of empty strings for mailer. + The source code tries to detect an empty string in + a defective manner. This can be used to crash the + program at first attempt to send a mail notification. + . + The configuration parameters are checked in order to + disable the mainling service in case of misused strings. + program abortion. + . + The sample configuration is updated to display the correct + MTA-string, the value already hardcoded into the program. +Author: Mats Erik Andersson +Forwarded: yes +Last-Update: 2011-03-22 + +diff -Naur ipband-0.8.1.debian/init.c ipband-0.8.1/init.c +--- ipband-0.8.1.debian/init.c 2011-03-22 15:00:21.000000000 +0100 ++++ ipband-0.8.1/init.c 2011-03-22 17:15:05.000000000 +0100 +@@ -31,7 +31,7 @@ + printf(" -b kBps - Default bandwidth threshold in kBytes.\n"); + printf(" per sec. Default is 7 kBps i.e 56 kbps.\n"); + printf(" -c filename - Read configuration file. Default is "); +- printf( "/etc/ipaband.conf.\n"); ++ printf( "/etc/ipband.conf.\n"); + printf(" -C - Ignore configuration file\n"); + printf(" -d level - Debug level: 0 - no debuging; 1 - summary;\n"); + printf(" 2 - subnet stats; 3 - all packets captured.\n"); +@@ -585,4 +585,13 @@ + if( (top_m < 0) ) + err_quit("ERROR: negative per-host connection report limit\n"); + ++ if( mailto_m && mtastring_m && ++ (strlen(mailto_m) == 0 || strlen(mtastring_m) == 0) ) { ++ /* Remove these obviously faked values, ++ * thus disabling any reports by the mailer. */ ++ FREE(mailto_m); ++ FREE(mtastring_m); ++ err_msg("ERROR: Misconfigured `mtastring_m` was left empty."); ++ err_msg(" Program is continuing wothout mailing any reports."); ++ } + } +diff -Naur ipband-0.8.1.debian/ipband.sample.conf ipband-0.8.1/ipband.sample.conf +--- ipband-0.8.1.debian/ipband.sample.conf 2008-06-17 19:23:19.000000000 +0200 ++++ ipband-0.8.1/ipband.sample.conf 2011-03-22 15:35:58.000000000 +0100 +@@ -58,10 +58,11 @@ + # ASCII file to use as e-mail report footer. + #mailfoot /etc/ipband.foot + +-# MTA string. Default is "/usr/sbin/sendmail -t -ba". Change it to +-# whatever runs MTA of your choice. Note that the stringis tokenized and +-# passed to exec(), so that shell's metacharacters are not interpreted. +-#mtastring "/usr/sbin/sendmail -t -ba" ++# MTA string. Default is "/usr/sbin/sendmail -t -oi". Change it ++# to whatever runs the MTA of your choice. Note that the string ++# is tokenized and passed to exec(), so that shell's metacharacters ++# are not interpreted. ++#mtastring "/usr/sbin/sendmail -t -oi" + + # Default number of subnet mask bits. + #maskbits 24 +diff -Naur ipband-0.8.1.debian/popen.c ipband-0.8.1/popen.c +--- ipband-0.8.1.debian/popen.c 2008-06-17 19:23:19.000000000 +0200 ++++ ipband-0.8.1/popen.c 2011-03-22 15:17:12.000000000 +0100 +@@ -35,7 +35,7 @@ + pid_t pid; + FILE *fp; + +- if(cmd == NULL || cmd == "") ++ if(cmd == NULL || *cmd == '\0') + return(NULL); + + if ((type[0] != 'r' && type[0] != 'w') || type[1] != 0) { +diff -Naur ipband-0.8.1.debian/reports.c ipband-0.8.1/reports.c +--- ipband-0.8.1.debian/reports.c 2011-03-22 15:00:21.000000000 +0100 ++++ ipband-0.8.1/reports.c 2011-03-22 15:21:52.000000000 +0100 +@@ -302,7 +302,7 @@ + } + /* Sendmail headers */ + fprintf(sendmail,"To: %s\n",mailto_m); +- fprintf(sendmail,"From: IP bandwdth watchdog <>\n"); ++ fprintf(sendmail,"From: IP bandwidth watchdog <>\n"); + } + + } diff -Nru ipband-0.8.1/debian/patches/series ipband-0.8.1/debian/patches/series --- ipband-0.8.1/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ ipband-0.8.1/debian/patches/series 2011-03-22 15:00:41.000000000 +0000 @@ -0,0 +1,4 @@ +01_fix_makefile.dpatch +02_manpage_spelling_errors.diff +03_compiler_warnings.diff +04_check_mailer_strings.diff diff -Nru ipband-0.8.1/debian/README.source ipband-0.8.1/debian/README.source --- ipband-0.8.1/debian/README.source 2011-04-30 19:24:23.000000000 +0000 +++ ipband-0.8.1/debian/README.source 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -This package uses dpatch to manage all modifications to the upstream -source. Changes are stored in the source package as diffs in -debian/patches and applied during the build. - -To get the fully patched source after unpacking the source package, cd -to the root level of the source package and run: - - debian/rules patch - -Removing a patch is as simple as removing its entry from the -debian/patches/00list file, and please also remove the patch file -itself. - -Creating a new patch is done with "dpatch-edit-patch patch XX_patchname" -where you should replace XX with a new number and patchname with a -descriptive shortname of the patch. You can then simply edit all the -files your patch wants to edit, and then simply "exit 0" from the shell -to actually create the patch file. - -To tweak an already existing patch, call "dpatch-edit-patch XX_patchname" -and replace XX_patchname with the actual filename from debian/patches -you want to use. - -To clean up afterwards again, "debian/rules unpatch" will do the -work for you - or you can of course choose to call -"fakeroot debian/rules clean" all together. - - - diff -Nru ipband-0.8.1/debian/rules ipband-0.8.1/debian/rules --- ipband-0.8.1/debian/rules 2011-04-30 19:24:23.000000000 +0000 +++ ipband-0.8.1/debian/rules 2010-10-21 13:54:13.000000000 +0000 @@ -1,63 +1,4 @@ #!/usr/bin/make -f -# Sample debian/rules that uses debhelper. -# GNU copyright 1997 to 1999 by Joey Hess. -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -include /usr/share/dpatch/dpatch.make - -ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) - CFLAGS += -O0 -endif -ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) - INSTALL_FLAGS += -s -endif - -configure: configure-stamp -configure-stamp: - dh_testdir - touch configure-stamp - - -build: patch-stamp build-stamp - -build-stamp: configure-stamp - dh_testdir - CFLAGS="-g -Wall $(CFLAGS)" $(MAKE) - touch build-stamp - -clean: unpatch - dh_testdir - rm -f build-stamp configure-stamp - $(MAKE) clean - dh_clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - $(MAKE) install DESTDIR=$(CURDIR)/debian/ipband - - -binary-indep: build install - -binary-arch: build install - dh_testdir - dh_testroot - dh_installdocs - dh_installexamples debian/ipband.conf-simple debian/ipband.conf-verbose - dh_installinit - dh_installchangelogs CHANGELOG - dh_strip - dh_compress - dh_fixperms - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install configure +%: + dh $@ diff -Nru ipband-0.8.1/debian/source/format ipband-0.8.1/debian/source/format --- ipband-0.8.1/debian/source/format 1970-01-01 00:00:00.000000000 +0000 +++ ipband-0.8.1/debian/source/format 2011-04-30 19:24:24.000000000 +0000 @@ -0,0 +1 @@ +3.0 (quilt) diff -Nru ipband-0.8.1/debian/watch ipband-0.8.1/debian/watch --- ipband-0.8.1/debian/watch 2011-04-30 19:24:23.000000000 +0000 +++ ipband-0.8.1/debian/watch 2010-10-21 12:53:01.000000000 +0000 @@ -1,3 +1,3 @@ # watch control file for ipband version=3 -http://ipband.sourceforge.net ipband-(.*)\.tgz +http://ipband.sourceforge.net/ ipband-(.*)\.tgz