debian/0000775000000000000000000000000012317055226007173 5ustar debian/copyright0000664000000000000000000001121211354450152011120 0ustar This package was debianized by Laurent Guignard on Tue, 08 Oct 2008 15:53:17 +0200. It was downloaded from http://www.net.princeton.edu/software/dhcp_probe/ Upstream Author: Irwin Tillman Copyright: (©) 2000-2008, The Trustees of Princeton University License: dhcp_probe was created by the Network Systems Group at Princeton University's Office of Information Technology, networking at princeton dot edu. It was written by Irwin Tillman. Portions of this software are copyrighted by other organizations or individuals; see below for details one which portions, and what legal notices apply to each of those portions. Those portions of the software which have not identified below as copyrighted by other organizations or individuals are themselves Copyright (©) 2000-2008, The Trustees of Princeton University, All Rights Reserved. Redistribution and use in source and binary form, with or without modification, are permitted provided that the following conditions are met: * The redistribution, use, or modification shall not violate any of the additional copyrights, patents, or other restrictions below. * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * If redistribution includes any portion of the software that is copyrighted by other organizations or individuals (as detailed below), the copyright notice associated with that portion of the software also must be retained. * Neither the names of the individual authors or contributos, nor the name of "Princeton University" may be used to endorse or promote products derived from this software without specific prior written permission. This software is provided "as is" and any express or implied warranties, including, but not limited to, the implied warranties of mechantability and fitness for a particular purpose are disclaimed. In no event shall the authors or Princeton University be liable for any direct, indirect, incidental, special exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. All files listed below have different copyright and/or license: "lib/inet_aton.c" Copyright: (©) 1983, 1990, 1993 The Regents of the University o f California. Portions Copyright (©) 1993 by Digital Equipment Corporation. License: GNU Library General Public License, Version 2. "src/report.c" and "lib/strerror.c" Copyright: (©) 1996 by Carnegie Mellon University. Licence: Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of CMU not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. "aclocal.4" Macro AC_CHECK_STRUCT_FOR Copyright: (©) Wes Hardaker License: GNU General Public License version 2 "aclocal.m4" and "m4/sys_errlist.m4" and "lib/strerror.c": Macros AC_SYS_NERR, AC_SYS_ERRLIST, AC_DECL_SYS_ERRLIST, AC_DECL_SYS_ERR_DECL Copyright: (©) License:œGNU General Public License. The macros are based very closely on code from LPRng's configure.in file. LPRng-2.0.8 is distributed under the GNU General Public License. License: The Debian packaging is (©) 2008, Laurent Guignard and is licensed under the GPL version 2, see `/usr/share/common-licenses/GPL-2'. This license is also compatible with the LGPL version 2, see `/usr/share/common-licenses/LGPL-2'. debian/README.Debian0000664000000000000000000000303511354450152011232 0ustar dhcp-probe (1.3.0-3) unstable; urgency=low This version is "build-depend" on dpkg-dev (>=1.15.4) because the architecture detection system. In addition, this version of dhcp-probe fit the 3.8.3 policy version. dhcp-probe (1.3.0-1) unstable; urgency=low New upstream version (1.3.0) packaging, closing bug #522000. This version includes new scripts (alert_program_name2 and dhcp_probe_notify2) which help to differentiate malicious rogue servers due to Trojan.Flush.M virus. Fixed services dependencies in init script. Thanks Nelson A. de Oliveira for his patch closing bug #521997. Fixed mktemp template in postinst, closing bug #521765. Bumped standards version to 3.8.1 to fit the new Debian policy. Dropped build dependency on build-essential libc6-dev that fixes FTBFS on several architectures, closing the bug #524771. Fixed bug for upstream required /etc/dhcp_probe.cf file. This bug was discovered by package maintainer and doesn't fix any bug from the Debian Bug Tracking System. Fixed bug in postrm which has to be idempotent and failed when previous package install failed. This bug was discovered by package maintainer and doesn't fix any bug from the Debian Bug Tracking System. Add ${misc:Depends} in control file to fix debhelper V4 recommandation. -- Laurent Guignard Tue, 14 Apr 2009 14:44:14 +0200 dhcp-probe (1.2.2-1) unstable; urgency=low Initial released that close bug #495959. -- Laurent Guignard Thu, 29 Jan 2009 10:12:05 +0100 debian/dhcp-probe.examples0000664000000000000000000000001111354450152012743 0ustar extras/* debian/dhcp-probe.dirs0000664000000000000000000000010611444221342012070 0ustar usr/sbin etc/init.d etc/dhcp-probe usr/share/doc/dhcp-probe/examples debian/README.source0000664000000000000000000000237311455136043011356 0ustar This file describe the process in order to build manually dhcp-probe package Patches description ------------------- Patches are located in debian/patches directory. These patches were created with quilt tool. There are two patches on man pages to fix "roff" syntax. The third patch is about a C syntax problem that could cause segfault on several architecture. This patch was submit by Dann Frazier and will be integrated to the upstream source code in next releases by Irwin Tillman . The Fourth patch is to adapt sources to several architectures (32 or 64 bits). This patch was written by Laurent Guignard with Ilkka Virta help in C encoding. Thanks for this help. Actually all patches were sent to the upstream programmer Irwin Tillman . Patching method --------------- If you need to apply patches manually, there are only two patches (third and fourth) required to compile dhcp-probe source code. To manually apply patches, you could refer to man (1) quilt. Main commands are : - quilt applied List applied patches - quilt pop -a Remove all applied patches -quilt push -a Apply all patches from a series file debian/dhcp-probe.postrm0000664000000000000000000000252711354450152012467 0ustar #!/bin/sh # postrm script for dhcp-probe # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `remove' # * `purge' # * `upgrade' # * `failed-upgrade' # * `abort-install' # * `abort-install' # * `abort-upgrade' # * `disappear' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package PACKAGE="dhcp-probe" CONFDEST="/etc/$PACKAGE" UPSTRCONF="/etc/dhcp_probe.cf" UCF_CONF="/etc/ucf.conf" UCF_BIN=`which ucf || true` case "$1" in remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;; purge) if test -z "$UCF_BIN"; then # ucf has been removed rm -rf "$CONFDEST" rm -f "$UPSTRCONF" else if test -d "$CONFDEST"; then for i in `find $CONFDEST/ -type f -print`; do ucf --purge "$i" rm -f "$i" done ucf --purge "$CONFDEST" rm -rf "$CONFDEST" fi ucf --purge "$UPSTRCONF" rm -f "$UPSTRCONF" fi echo "dhcp-probe purge done !" ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 1 ;; esac #DEBHELPER# exit 0 debian/dhcp-probe.docs0000664000000000000000000000006711354450152012070 0ustar NEWS README TODO AUTHORS PLATFORMS debian/maintfiles/* debian/changelog0000664000000000000000000001103612317055216011045 0ustar dhcp-probe (1.3.0-10ubuntu1) trusty; urgency=low * Use autotools-dev helper for newer arches, resolving FTBFS. -- Daniel T Chen Wed, 02 Apr 2014 14:44:10 -0400 dhcp-probe (1.3.0-10) unstable; urgency=low * Fix rules script (add build-arch and build-indep target) * Fix dhcp-probe.init.d script to add Description field of LSBInitScripts -- Laurent Guignard Thu, 24 Nov 2011 21:41:08 +0100 dhcp-probe (1.3.0-9) unstable; urgency=low * Fix rules script to suite 3.9.2 Debian policy, * Fix dhcp-probe.init.d file. -- Laurent Guignard Tue, 25 Oct 2011 21:34:32 +0200 dhcp-probe (1.3.0-8) unstable; urgency=low * Fix bashisms in dhcp-probe.init.d script (closes: #619045). Thanks to Cristian Ionescu-Idbohrn for his bug submit and solution proposal. * Fix dependency problem for kfreebsd Debian port (closes: #620644). Thanks to Julien Cristau for his bug submit. This cause iproute package depency removal. -- Laurent Guignard Thu, 28 Apr 2011 17:21:44 +0200 dhcp-probe (1.3.0-7) unstable; urgency=low * Fix dhcp-probe.init.d script to display messages at right place, update code to avoid PID file reading error to be displayed. * Fix dependence on iproute package (closes: #603918) -- Laurent Guignard Tue, 23 Nov 2010 22:23:17 +0100 dhcp-probe (1.3.0-6) unstable; urgency=low * Fix dhcp-probe.init.d script revision, thanks Cristian Ionescu-Idbohrn for patch (closes: #586595). * Add documentation for Debian developers in README.Debian file. -- Laurent Guignard Tue, 12 Oct 2010 21:55:02 +0200 dhcp-probe (1.3.0-5) unstable; urgency=low * Fix dhcp-probe.postinst with missing net-tools package dependency. * Switch to dpkg-source 3.0 (quilt) format. * Fix problem in init script to detect dhcp-probe process. * Fix spelling problem dhcp-probe.8 manpage. * Fix dhcp-probe.postrm script, thanks Johann Felix Soden for the patch(closes: #574210). -- Laurent Guignard Sun, 04 Apr 2010 13:48:26 +0200 dhcp-probe (1.3.0-4) unstable; urgency=low * Fix dhcp-probe.postrm file problem when ucf is removed before dhcp-probe purge. * Add patch and unpatch target in rules file. -- Laurent Guignard Tue, 22 Dec 2009 14:31:21 +0100 dhcp-probe (1.3.0-3) unstable; urgency=low * Fix dhcp-probe.postinst script (closes: #535172). * Fix postrm problem on /etc/dhcp_probe.cf file. * Fix dhcp-probe.init.d script to enable -T option (Thanks to Ilkka Virta ). * Fix dhcp-probe.init.d script (closes: #542350). Thanks to Petter Reinholdtsen for the patch. * Add patch to adapt src/get_myipaddr.c file to 32 or 64 bits system by pre-compilation directive in source code and debian/rules file update (closes: #535361). -- Laurent Guignard Mon, 24 Aug 2009 14:17:48 +0200 dhcp-probe (1.3.0-2) unstable; urgency=low * Fix implicit pointer conversion in bootp.c line 56. Thanks to Dann Frazier (closes: #529635). -- Laurent Guignard Thu, 21 May 2009 10:08:14 +0200 dhcp-probe (1.3.0-1) unstable; urgency=low * New upstream version (closes: #522000). * Fixed dependencies in init script. Thanks Nelson A. de Oliveira for the patch (closes: #521997). * Fixed mktemp template in postinst (closes: #521765). * Bumped standards version to 3.8.1 (no changes required). * Dropped build dependency on build-essential libc6-dev (also fixes FTBFS on several architectures). * Added Homepage: control field. * Fix handling of /etc/dhcp_probe.cf. * Ensure idempotency of installation in postrm. * Fixed libnet1 dependency to 1.1.2.1-3 package version according to required version with libnet_cq_end_loop(...) function. * Add ${misc:Depends} in control file to fix debhelper V4 recommandation. * Add README.Debian to document and justify changes done on package. * Removed build-dependency on libc6-dev (>=2) (closes: #524771). -- Laurent Guignard Wed, 29 Apr 2009 12:22:01 +0200 dhcp-probe (1.2.2-1) unstable; urgency=low * Initial released. * Closes: bug#495959. * 00_doc_dhcp_probe.8.dpatch : replace -Q to \-Q of doc/dhcp_probe.8. -- Laurent Guignard Thu, 29 Jan 2009 10:12:05 +0100 debian/dhcp-probe.init.d0000775000000000000000000001117711663525036012343 0ustar #!/bin/sh ### BEGIN INIT INFO # Provides: dhcp-probe # Required-Start: $local_fs $remote_fs $syslog $network $all # Required-Stop: $local_fs $remote_fs $syslog $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: dhcp-probe daemon to survey DHCP/BootP server on LAN # Description: Enable or disable dhcp-probe service ### END INIT INFO set -e PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/sbin/dhcp_probe LABEL=${DAEMON##*/} NAME=dhcp-probe PIDFILE=dhcp_probe.pid BASE_RUNNING=/var/run BASEPIDDIR=$BASE_RUNNING/$NAME INITPIDFILE=$BASEPIDDIR/$PIDFILE DESC="$NAME daemon" ETC=/etc LOGDIR=/var/log/$NAME.log DODTIME=2 test -x $DAEMON || exit 0 if [ -r /lib/lsb/init-functions ]; then . /lib/lsb/init-functions fi sourceable() { [ -r $1 ] || return 1 # Just to temporary files created by VIM case $1 in *\~) return 1 ;; esac } running() { INTERFACE=$1 PIDFILE=$INITPIDFILE.$INTERFACE _max_repeat=10 _repeat=1 while [ ! -r $PIDFILE ] && [ $_repeat -le $_max_repeat ]; do printf "Waiting for pid file round: $_repeat\n" >&2 sleep 1 _repeat=$(($_repeat + 1)) done printf "Waited ${_repeat}s to find a $INTERFACE pid file\n" >&2 if [ $_repeat -le $_max_repeat ]; then read pid < $PIDFILE || return 1 fi for i in `pidof dhcp_probe`; do if [ "$i" = "$pid" ]; then return 0 fi done return 1 } start_daemon() { # Start one daemon for each network interface [ -d $BASEPIDDIR ] || mkdir -p $BASEPIDDIR || { printf "Failed to create missing pid file directory $BASEPIDDIR!\n" return 1 } sts=0 for config_file in $ETC/$NAME/*; do sourceable $config_file || continue . $config_file PIDFILE=$INITPIDFILE.$INTERFACE DAEMON_OPTS="-T -p $PIDFILE $INTERFACE" printf "Starting $DESC on interface $INTERFACE: " max_repeat=10 repeat=1 while ip=$(sleep 1 printf "\nstart_daemon - Waiting for an ip on iface $INTERFACE, round: \ $repeat" >&2 /sbin/ifconfig $INTERFACE | grep inet\ | awk '{ print $2 }' | \ awk -F: '{ print $2 }' ) && [ -z "$ip" ] && [ $repeat -le $max_repeat ]; do repeat=$(($repeat + 1)) done printf "\nwaited ${repeat}s to get an ip on $INTERFACE" >&2 start-stop-daemon --start --quiet --pidfile $PIDFILE \ --exec $DAEMON -- $DAEMON_OPTS if running $INTERFACE; then printf "Done.\n" else printf "Failed!\n" sts=1 fi done return $sts } stop_daemon() { # Stop all existing dhcp_probe daemon for config_file in $ETC/$NAME/*; do sourceable $config_file || continue . $config_file PIDFILE=$INITPIDFILE.$INTERFACE if [ -r $PIDFILE ]; then printf "Stopping $DESC on interface $INTERFACE: " start-stop-daemon --stop --quiet --pidfile $PIDFILE printf "$NAME.\n" rm -f $PIDFILE else force_stop fi done } force_stop() { # Forcefully kill the process for config_file in $ETC/$NAME/*; do sourceable $config_file || continue . $config_file PIDFILE=$INITPIDFILE.$INTERFACE if [ -r "$PIDFILE" ]; then if running $INTERFACE; then start-stop-daemon -K 15 --quiet --pidfile $PIDFILE \ --exec $DAEMON -- $DAEMON_OPTS # Is it really dead? [ -z "$DODTIME" ] || sleep "$DODTIME" if running $INTERFACE; then start-stop-daemon -K 9 --quiet --pidfile $PIDFILE \ --exec $DAEMON -- $DAEMON_OPTS [ "$DODTIME" ] || sleep "$DODTIME" if running $INTERFACE; then printf "Cannot kill $LABEL (pid=$pid)!\n" exit 1 fi fi fi else killall `basename $DAEMON` fi rm -f $PIDFILE done } case $1 in start) start_daemon ;; stop) stop_daemon ;; force-stop) for config_file in $ETC/$NAME/*; do sourceable $config_file || continue . $config_file PIDFILE=$INITPIDFILE.$INTERFACE printf "Forcefully stopping $DESC: " force_stop if ! running $INTERFACE; then printf "$NAME on interface $INTERFACE.\n" else printf "Error !\n" fi done ;; force-reload) # Need to be improved printf "Reload operation is not supported -- use restart.\n" exit 1 ;; restart) printf "Restarting $DESC: " stop_daemon [ -z "$DODTIME" ] || sleep $DODTIME start_daemon printf "$NAME." ;; status) for config_file in $ETC/$NAME/*; do sourceable $config_file || continue . $config_file PIDFILE=$INITPIDFILE.$INTERFACE printf "$LABEL is " if running $INTERFACE; then printf "running on interface $INTERFACE.\n" else printf "not running.\n" exit 1 fi done ;; *) N=/etc/init.d/$NAME printf "Usage: $N {start|stop|restart|status|force-stop}\n" >&2 exit 1 ;; esac exit 0 debian/dhcp-probe.manpages0000664000000000000000000000004511354450152012727 0ustar doc/dhcp_probe.cf.5 doc/dhcp_probe.8 debian/patches/0000775000000000000000000000000011455125746010631 5ustar debian/patches/02_dhcp_probe.8.diff0000664000000000000000000000357611354450152014240 0ustar #! /bin/sh ## 02_dhcp_probe.8.diff by Laurent Guignard ## ## DP: Change a syntax problem in groff file for hyphenation problem ## Note: ## Submitted to upstream programmer Irwin Tillman. ## This patch will be applied in the next version of the upstream code. @DPATCH@ Index: trunk/doc/dhcp_probe.8 =================================================================== --- trunk.orig/doc/dhcp_probe.8 2010-03-15 21:55:49.000000000 +0100 +++ trunk/doc/dhcp_probe.8 2010-03-15 21:59:03.000000000 +0100 @@ -380,15 +380,15 @@ file, that program is executed, with the following required options: .nf - -p the name of the calling program (e.g. dhcp_probe) - -I the name of the interface on which the unexpected response packet was received - -i the IP source address of the packet - -m and the Ethernet source address of the packet + \-p the name of the calling program (e.g. dhcp_probe) + \-I the name of the interface on which the unexpected response packet was received + \-i the IP source address of the packet + \-m and the Ethernet source address of the packet .fi If the response packet's yiaddr is non-zero and falls within a "Lease Networks of Concern", the following optional options are also passed: .nf - -y the non-zero yiaddr value + \-y the non-zero yiaddr value .fi (We do not wait for the .I alert_program_name2 @@ -874,11 +874,11 @@ Configuration file read by the program. See .BR dhcp_probe.cf (5). -The name of this file can be overriden by a command-line option. +The name of this file can be overridden by a command-line option. .TP .B /etc/dhcp_probe.pid Contains the program's processid. -The name of this file can be overriden by a command-line option. +The name of this file can be overridden by a command-line option. .SH LIMITATIONS dhcp_probe is not guaranteed to locate all unknown DHCP and BootP debian/patches/03_implicit_point_conv_bootp.c.diff0000775000000000000000000000100711354450152017450 0ustar #! /bin/sh ## 03_implicit_point_conv_bootp.c.diff by Laurent Guignard ## ## DP: Fix implicit Pointer Converstion in bootp.c file. ## Fix bug #529635 discovered by Dann Frazier ## @DPATCH@ diff -urNad trunk~/src/bootp.c trunk/src/bootp.c --- trunk~/src/bootp.c 2009-03-31 14:19:06.000000000 +0200 +++ trunk/src/bootp.c 2009-05-21 09:51:26.000000000 +0200 @@ -11,7 +11,7 @@ #include "bootp.h" #include "configfile.h" #include "report.h" - +#include "utils.h" debian/patches/series0000664000000000000000000000015111354450152012031 0ustar 01_dhcp_probe.5.diff 02_dhcp_probe.8.diff 03_implicit_point_conv_bootp.c.diff 04_linux_32_or_64bits.diff debian/patches/01_dhcp_probe.5.diff0000775000000000000000000000400011354450152014216 0ustar #! /bin/sh ## 01_dhcp_probe.5.diff by Laurent Guignard ## ## DP: Change a syntax problem in groff file for hyphenation problem ## Note: ## Submitted to upstream programmer Irwin Tillman. ## This patch will be applied in the next version of the upstream code. @DPATCH@ diff -urNad trunk~/doc/dhcp_probe.cf.5 trunk/doc/dhcp_probe.cf.5 --- trunk~/doc/dhcp_probe.cf.5 2009-03-30 14:53:40.000000000 +0200 +++ trunk/doc/dhcp_probe.cf.5 2009-03-30 14:57:05.000000000 +0200 @@ -472,10 +472,10 @@ .PP .RS .nf --p the name of the calling program (e.g. dhcp_probe), --I the name of the interface on which the unexpected response packet was received --i the IP source address of the packet --m Ethernet source address of the packet +\-p the name of the calling program (e.g. dhcp_probe), +\-I the name of the interface on which the unexpected response packet was received +\-i the IP source address of the packet +\-m Ethernet source address of the packet .fi .RE .PP @@ -483,7 +483,7 @@ .PP .RS .nf --y the non-zero yiaddr value from the packet, when it falls inside a "Lease Network of Concern" +\-y the non-zero yiaddr value from the packet, when it falls inside a "Lease Network of Concern" .fi .RE .PP @@ -723,7 +723,7 @@ # alert_program_name2 /absolute/path/name # # The program specified via 'alert_program_name2' will be called as follows: -# /absolute/path/name -p name_of_calling_program -I name_of_interface_on_which_the_response_was_received -i IP_source_of_the_response -m ether_src_of_the_response [-y yiaddr_when_in_lease_networks_of_concern] +# /absolute/path/name \-p name_of_calling_program \-I name_of_interface_on_which_the_response_was_received \-i IP_source_of_the_response \-m ether_src_of_the_response [\-y yiaddr_when_in_lease_networks_of_concern] # The options may appear in any order. # The program must silently ignore any options or arguments it does not recognize, # so as to be forward-compatible with future enhancements to dhcp_probe. debian/patches/04_linux_32_or_64bits.diff0000775000000000000000000000213411354450152015315 0ustar #! /bin/sh ## 04_linux_32_or_64bits.diff by Laurent Guignard ## ## DP: A solution to solve the bug #535361 ## May be this will be a solution with the right method ??? @DPATCH@ diff -urNad trunk~/src/get_myipaddr.c trunk/src/get_myipaddr.c --- trunk~/src/get_myipaddr.c 2009-09-03 13:10:32.000000000 +0200 +++ trunk/src/get_myipaddr.c 2009-09-03 13:15:39.671451172 +0200 @@ -118,7 +118,21 @@ #endif /* not STRUCT_SOCKADDR_HAS_SA_LEN */ /* increment ptr to next interface for next time through the loop */ +#ifdef __ARCH__ /* Debian GNU/Linux behavior for packaging goal */ + switch(__ARCH__) { + case 32: /* 32 bits architectures */ + ptr += sizeof(ifr->ifr_name) + len; + break; + case 64: /* 64 bits architectures */ + ptr += sizeof(struct ifreq); + break; + default: /* Default dhcp_probe behavior */ + ptr += sizeof(ifr->ifr_name) + len; + break; + } +#else /* Default dhcp_probe behavior */ ptr += sizeof(ifr->ifr_name) + len; +#endif if (strcmp(ifname, ifr->ifr_name) != 0 ) /* is this the interface we're looking for? */ continue; debian/watch0000664000000000000000000000020211354450152010213 0ustar version=3 opts=filenamemangle=s/dhcp_probe/dhcp-probe/ \ http://www.net.princeton.edu/software/dhcp_probe/dhcp_probe-(.*).tar.gz debian/maintfiles/0000775000000000000000000000000011354450152011323 5ustar debian/maintfiles/dhcp_probe.tpl.eth00000664000000000000000000000021511354450152015006 0ustar # # Template file for dhcp_probe interface configuration # INTERFACE="eth0" MAC="00:00:00:00:00:00" IPV4="1.2.3.4" IPV4_MASK="255.255.255.0" debian/control0000664000000000000000000000163312317054743010604 0ustar Source: dhcp-probe Section: net Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Laurent Guignard Build-Depends: debhelper (>= 7), quilt, autotools-dev, libpcap-dev (>= 0.9), libnet1-dev (>= 1.1.2.1-3), dpkg-dev (>=1.15.4) Standards-Version: 3.9.2 Homepage: http://www.net.princeton.edu/software/dhcp_probe/ Package: dhcp-probe Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, ucf, libpcap0.8 (>= 0.9), libnet1 (>= 1.1.2.1-3), net-tools Description: network DHCP or BootP server discover dhcp_probe attempts to discover DHCP and BootP servers on a directly-attached Ethernet network. A network administrator can use this tool to locate un- authorized DHCP and BootP servers. Essentially, dhcp_probe mimics a BootP or DHCP client in a variety of possible states, attempting to provoke responses from servers. debian/dhcp-probe.postinst0000664000000000000000000000525311556303547013036 0ustar #!/bin/sh # piston's script for dhcp-probe # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-remove' # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package PACKAGE="dhcp-probe" CONF_DIR="/etc/$PACKAGE" CONF_FILE="/etc/dhcp_probe.cf" MSG="dhcp-probe: IP not configured on host, please see template file" MSG="$MSG /usr/share/doc/dhcp-probe/dhcp_probe.tpl.eth0 to configure !" # # Dynamic configuration procedure # if test -f /lib/lsb/init-functions then . /lib/lsb/init-functions fi # # postinst script main # case "$1" in configure) IFCONFIG='/sbin/ifconfig' DEST="/etc/$PACKAGE/$PACKAGE" NB_FILE=`ls -1 "$CONF_DIR" | wc -l` if test "$NB_FILE"="0" then # Configuration doesn't exist interfaces=`$IFCONFIG | grep Ethernet | awk '{ print $1 }';` if test -n "$interfaces" then for i in $interfaces; do ether=`$IFCONFIG | grep -e "^$i" | awk '{ print $5 }';` eth_lines=`$IFCONFIG | grep -A 3 $i` inet=`echo $eth_lines | awk '{ print $6 }';` if test $inet = 'inet' then ipv4=`echo $eth_lines | awk '{ print $7 }' | awk -F: '{ print $2 }'` ipv4_mask=`echo $eth_lines | awk '{ print $8 }' | awk -F: '{ print $2 }'` TMPDEST=`mktemp -t $PACKAGE.XXXXXXXX` echo "#" > "$TMPDEST.$i" echo "# Automaticaly generated file during dhcp-probe package install procedure" >> "$TMPDEST.$i" echo "#" >> "$TMPDEST.$i" echo "INTERFACE=\"$i\"" >> "$TMPDEST.$i" echo "MAC=\"$ether\"" >> "$TMPDEST.$i" echo "IPV4=\"$ipv4\"" >> "$TMPDEST.$i" echo "IPV4_MASK=\"$ipv4_mask\"" >> "$TMPDEST.$i" ucf "$TMPDEST.$i" "$DEST.$i" logger -i -p daemon.crit "$TMPDEST.$i installed." rm -f $TMPDEST else echo "IP V4 isn't configured on interface $i !" | tee | logger -i -p daemon.crit fi ether="" eth_lines="" done fi fi DHCP_PROBE_CF=`mktemp -t $PACKAGE.XXXXXXXX` if test ! -f "$CONF_FILE"; then ucf "$DHCP_PROBE_CF" "$CONF_FILE" fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac #DEBHELPER# exit 0 debian/source/0000775000000000000000000000000011354450152010470 5ustar debian/source/format0000664000000000000000000000001411354450152011676 0ustar 3.0 (quilt) debian/compat0000664000000000000000000000000211354450152010366 0ustar 7 debian/rules0000775000000000000000000000344612317055167010266 0ustar #!/usr/bin/make -f include /usr/share/quilt/quilt.make # These are used for cross-compiling and for saving the configure script # from having to guess our platform (since we know it already) #DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) # Changed to suite 3.9.2 policy DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) DEB_HOST_ARCH_BITS := $(shell dpkg-architecture -qDEB_HOST_ARCH_BITS 2>/dev/null) # Information about package PACKAGE_NAME = dhcp-probe CFLAGS = -Wall -g ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif CFLAGS += -D__ARCH__=$(DEB_HOST_ARCH_BITS) config.status: configure dh_testdir configure dh_autotools-dev_updateconfig dh_auto_configure -- --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr \ --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info \ CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs" build: build-stamp build-stamp: config.status dh_testdir Makefile dh_auto_build build-arch: build build-indep: build clean: dh_testdir dh_testroot dh_clean stamp-h* dh_auto_clean dh_autotools-dev_restoreconfig dh_clean distclean: dh_clean stamp-h* dh_auto_clean -- distclean install: build dh_testdir dh_testroot dh_prep dh_installdirs dh_auto_build -- DESTDIR=$(CURDIR)/debian/$(PACKAGE_NAME) install binary-indep: build install binary-arch: build install dh_testdir dh_testroot dh_installchangelogs ChangeLog dh_installdocs dh_installexamples dh_installman dh_strip dh_compress dh_fixperms dh_installinit -- defaults dh_makeshlibs dh_shlibdeps dh_installdeb dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install debian/TODO.Debian0000664000000000000000000000006611455136415011050 0ustar * Clean the dhcp-probe.init.d file from used code *