--- snooper-19991202.orig/debian/README.Debian +++ snooper-19991202/debian/README.Debian @@ -0,0 +1,48 @@ +The Debian snooper package installs /usr/bin/snooper as a normal +executable program, with no special privileges. + +Debian systems normally have the serial devices, /dev/ttyS0, +/dev/ttyS1, etc., secured so that users must be in the group 'dialout' +to read/write those devices. + +You should therefore add the user(s) you want to be able to run +snooper to the 'dialout' group. For example, the following +command gives user 'joe' the ability to use snooper (and anything +else that opens and reads/writes the /dev/ttySn serial ports): + + # adduser joe dialout + +(Note that user joe will have to log in again, or use a 'newgrp' +or 'sg' command, in order to see the change.) + + +Alternatively, you might want to make snooper set-group-id +'dialout.' In this way it will run as that group, for any user: + + # chown dialout /usr/bin/snooper + # chmod g+s /usr/bin/snooper + + +--------------------------------------------------------------------- +Howto snoop traffic with only one computer and a modem: + +Connect the modem on the serial line and make sure, the serial port +is activated in your bios as well. + +Make a first try to get some information back from your modem with: + + # minicom -D /dev/ttyS0 (or your associated serial port) + +Your modem should answer to `AT` with an `OK` + +Start snooper with your available serial port and a non connected +port on your computer: + + # snooper ttyS0 ttyS1 (ttyS1 is not connected in our case) + +Now start minicom and send some lines to the modem: + + # minicom -D /dev/ttyS0 + +You should instantly see some characters showing up on snooper if you +state comments in your minicom window. --- snooper-19991202.orig/debian/README.source +++ snooper-19991202/debian/README.source @@ -0,0 +1,6 @@ +Building snooper for Debian +-------------------------------- + +The snooper source package uses quilt to apply and remove its patches. +Please refer to /usr/share/doc/quilt/README.source for information about how to +use quilt for source packages. --- snooper-19991202.orig/debian/changelog +++ snooper-19991202/debian/changelog @@ -0,0 +1,117 @@ +snooper (19991202-7.2) unstable; urgency=low + + * Non-maintainer upload. + * debian/patches/01-Unknown-changes-to-Makefile.in.diff: + Drop -DHAVE_LIBLOCKDEV from CFLAGS and -llockdev from LIBS to + disable liblockdev support (Closes: #728022). Ideally, the + upstream may wish to properly replace the UUCP-style locks + in uucplock.c with robust flock(2) locks. + + -- Roger Leigh Fri, 03 Jan 2014 16:32:47 +0000 + +snooper (19991202-7.1) unstable; urgency=low + + * Non-maintainer upload. + * FTBFS: -ltermcap doesn't work (Closes: #650599) + - debian/patches/07_fix_ncurses_linkage.diff + thanks to peter green + + -- HIGUCHI Daisuke (VDR dai) Mon, 09 Jan 2012 18:09:12 +0900 + +snooper (19991202-7) unstable; urgency=low + + * New Maintainer (Closes: #487735, #474336) + * Acknowledge NMU changes + * Bump Standards to 3.8.4 + * Get the package lintian clean + * Bump debhelper dependecies to 7.0.50 + * Extended README.Debian to show howto snoop traffic with only one + computer and a modem (Closes: #182656) + + -- Stefan Bauer Mon, 15 Feb 2010 09:51:17 +0100 + +snooper (19991202-6) unstable; urgency=low + + * QA upload. + * Bump Standards-Version to 3.8.2. + * Move to "minimal" debhelper 7 style. + * Use quilt instead of "manual" patch system. + * Move all .diff.gz changes to quilt. + * Fix FTBFS on avr32 by updating config.{sub,guess} from autotools-dev. + + -- Chris Lamb Sun, 02 Aug 2009 17:51:00 +0100 + +snooper (19991202-5) unstable; urgency=low + + * QA upload. + + Set maintainer to QA group. + * Bump debhelper compat level from 3 to 7. + + Reduce debian/rules slightly + * Add watch file + * Do not strip during installation. Closes: #438034 + + -- Frank Lichtenheld Wed, 06 Aug 2008 18:07:27 -0300 + +snooper (19991202-4.1) unstable; urgency=low + + * Non-maintainer upload. + * Fixed debian/rules to correctly remove patches, closes: #424245 + + -- Michael Meskes Wed, 09 Apr 2008 10:14:27 +0000 + +snooper (19991202-4) unstable; urgency=low + + * debian/rules: add and use simple 'patch' and 'unpatch' targets; + snooper is unsupported upstream, but some of our users have + been making nice improvements: + - add debian/patches/020_hex_and_timestamps.diff: + Thanks to Cristian Ionescu-Idbohrn , adds + options -x (hex only representation) and -t (write timestamps + in the log file), with corresponding additions to the + snooper man page. + Closes: #169224 snooper enhancements. + Also, thanks to additional comments in that bug report log, + added a missing .depend removal to the upstream build/Makefile + 'clean' target. + - add debian/patches/030_better_input_noforward_help.diff: + Thanks to Sebastian Andersson , adds a few + enhancements: safer input handling, a -n (no forwarding) + option, a -h (help) option, I (davidc) enhanced the patch + to also add these options to the man page. + Closes: #177589 Better input, "no forwarding," and help + - add debian/patches/040_interactive_command_synopsis.diff: + Also thanks to Sebastian Andersson , adds code to + present a list of valid keystrokes when an unrecognized key + is pressed. I (davidc) enhanced the patch to also mention + this new feature in the man page. + Closes: #177566 Some online help message. + * Replaced build/config.{guess,sub} with current autotools-dev files. + Closes: #302465 FTBFS on GNU/kFreeBSD. + * debian/rules, debian/control: respect new DEB_BUILD_OPTIONS; + Standards-Version now 3.6.2 + * src/snooper.1 (thanks to lintian) remove empty input lines + + -- David Coe Sun, 16 Oct 2005 02:47:36 -0400 + +snooper (19991202-3) unstable; urgency=low + + * actually set baud rate correctly, thanks to a patch + from Joe Augst + Closes: #160607: baud rate setting does not function + + -- David Coe Wed, 11 Sep 2002 22:58:43 -0400 + +snooper (19991202-2) unstable; urgency=low + + * corrected many errors in the man page (i.e. I + finished writing it -- sorry about that.) + Closes: #130045: Errors in the manpage + + -- David Coe Sun, 20 Jan 2002 02:40:03 -0500 + +snooper (19991202-1) unstable; urgency=low + + * first debianized version + Closes: #88416: ITP: snooper + + -- David Coe Mon, 26 Nov 2001 12:21:05 -0500 --- snooper-19991202.orig/debian/compat +++ snooper-19991202/debian/compat @@ -0,0 +1 @@ +7 --- snooper-19991202.orig/debian/control +++ snooper-19991202/debian/control @@ -0,0 +1,24 @@ +Source: snooper +Section: comm +Priority: optional +Maintainer: Stefan Bauer +Standards-Version: 3.8.4 +Build-Depends: debhelper (>= 7.0.50~), pmake, patch, libncurses5-dev, liblockdev1-dev, quilt, autotools-dev + +Package: snooper +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Captures communication between two external serial devices + Snooper passes data transparently between two serial (RS232C) + devices, capturing and logging the data and occasional comments you + want to insert into the logs. + . + It is useful for debugging or analyzing the communications protocol + between two devices that would normally be connected directly to each + other, e.g. a digital camera and a personal computer. By sitting + "in the middle" (after you connect the two devices to serial ports + on your Linux machine) snooper is able to capture data traveling in + either direction while also passing it unmodified to the other device. + . + It is also possible to operate with a single serial device, using + your console and keyboard as the second device. --- snooper-19991202.orig/debian/copyright +++ snooper-19991202/debian/copyright @@ -0,0 +1,75 @@ +This package was debianized by David Coe +on Sat, 3 Mar 2001 01:51:53 -0500. + +It was downloaded from +ftp://ftp.foretune.co.jp/pub/tools/snooper/snooper-19991202.tar.gz + +More information may be available at the author's web site: +http://www.itojun.org/itojun.html + + +Copyright + Copyright(c) 1997 by Jun-ichiro Itoh. All rights reserved. + +Warranty and redistribution + Absolutely no warranty. Pray before try. Freely redistributable. + + +A message from the author in response to my query about this software +being DFSG-compliant: + +---- +X-From-Line: itojun@iijlab.net Mon Mar 05 07:29:34 2001 +Return-Path: +Delivered-To: david@someotherplace.org +Received: from master.debian.org (master.debian.org [216.234.231.5]) + by moe.coe.woodbine.md.us (Postfix) with ESMTP id ACE03688B + for ; Sun, 4 Mar 2001 17:49:18 -0500 (EST) +Received: from nat-kuma.camp.wide.ad.jp (starfruit.itojun.org) [::ffff:203.178.140.115] + by master.debian.org with esmtp (Exim 3.12 1 (Debian)) + id 14ZhJU-0002DH-00; Sun, 04 Mar 2001 16:49:16 -0600 +Received: from itojun.org (localhost [127.0.0.1]) + by starfruit.itojun.org (Postfix) with ESMTP + id 92C7A7E0E; Mon, 5 Mar 2001 07:29:34 +0900 (JST) +To: David Coe +Cc: freesoftware@itojun.org +In-reply-to: davidc's message of 04 Mar 2001 13:52:54 EST. + <863dctqsc9.fsf@someotherplace.org> +X-Template-Reply-To: itojun@itojun.org +X-Template-Return-Receipt-To: itojun@itojun.org +X-PGP-Fingerprint: F8 24 B4 2C 8C 98 57 FD 90 5F B4 60 79 54 16 E2 +Subject: Re: introduction (and a license question) +From: Jun-ichiro itojun Hagino +Date: Mon, 05 Mar 2001 07:29:34 +0900 +Sender: itojun@itojun.org +Message-Id: <20010304222934.92C7A7E0E@starfruit.itojun.org> +Status: +X-Content-Length: 1038 +Lines: 25 + + +>My name is David Coe, and I'm one of the Debian (www.debian.org) +>GNU/Linux maintainers. +> +>I've recently taken over responsibility for the Debian package of your +>"camediaplay" and would also like to package your "snooper" program. +> +>Both of these programs contain very brief copyright/license statements +>in their README files, and Debian must be very careful that we don't +>claim a software package is free (as in "freedom") if that is not what +>you intended. +> +>Having read your web site and resume, I suspect you agree with the +>Debian Free Software Guidelines (DFSG -- available in many languages +>at http://www.debian.org/social_contract#guidelines ). If that is +>true, would you reply confirming that fact, or (perhaps better for us +>both) would you include a statement in your programs' licenses +>granting the rights described in the DFSG? + + + thanks for checking. for the above software packages, + i'm okay with DFSG. I don't really work on the programs any more, + and I do not really plan to ship a new tar.gz kit. + +itojun + --- snooper-19991202.orig/debian/dirs +++ snooper-19991202/debian/dirs @@ -0,0 +1 @@ +usr/bin --- snooper-19991202.orig/debian/docs +++ snooper-19991202/debian/docs @@ -0,0 +1 @@ +README --- snooper-19991202.orig/debian/manpages +++ snooper-19991202/debian/manpages @@ -0,0 +1 @@ +debian/snooper.1 --- snooper-19991202.orig/debian/patches/01-Unknown-changes-to-Makefile.in.diff +++ snooper-19991202/debian/patches/01-Unknown-changes-to-Makefile.in.diff @@ -0,0 +1,60 @@ +Subject: [PATCH] Unknown changes to Makefile.in + +Imported from .diff.gz. +--- + build/Makefile.in | 18 ++++++++++++------ + 1 files changed, 12 insertions(+), 6 deletions(-) + +diff --git a/build/Makefile.in b/build/Makefile.in +index 3e37459..03d6406 100644 +--- a/build/Makefile.in ++++ b/build/Makefile.in +@@ -2,12 +2,13 @@ + srcdir=@srcdir@/.. + CC= @CC@ + OPTFLAG=@OPTFLAG@ +-CFLAGS= -c $(OPTFLAG) -I. -I$(srcdir)/include @CFLAGS@ ++CFLAGS= -c $(OPTFLAG) -I. -I$(srcdir)/include @CFLAGS@ ++LIBS=@LIBS@ + LDFLAGS=@LDFLAGS@ + INSTALL=@INSTALL@ + + prefix= @prefix@ +-bindir= @bindir@ ++bindir= $(DESTDIR)@bindir@ + datadir=@datadir@ + mandir= @mandir@ + exec_prefix= @exec_prefix@ +@@ -17,23 +18,28 @@ OBJS= main.o scrn.o log.o binlog.o uucplock.o + all: snooper + + snooper: $(OBJS) +- $(CC) -o snooper $(OBJS) @LIBS@ ++ $(CC) -o snooper $(OBJS) $(LIBS) + + main.o: ../src/main.c ++ $(CC) $(CFLAGS) -c $< + scrn.o: ../src/scrn.c ++ $(CC) $(CFLAGS) -c $< + log.o: ../src/log.c ++ $(CC) $(CFLAGS) -c $< + binlog.o: ../src/binlog.c ++ $(CC) $(CFLAGS) -c $< + uucplock.o: ../src/uucplock.c ++ $(CC) $(CFLAGS) -c $< + + depend: +- mkdep ${CFLAGS:M-[ID]*} $(srcdir)/src/*.c ++ mkdep ${CFLAGS} $(srcdir)/src/*.c + + install: + [ -d $(bindir) ] || (mkdir $(bindir)) +- $(INSTALL) -s -o uucp -g bin -m 4555 snooper $(bindir) ++ $(INSTALL) -o uucp -g bin -m 4555 snooper $(bindir) + + clean: +- -rm -f *.o *.core ++ -rm -f *.o *.core .depend + -rm -f $(OBJS) snooper + + distclean: clean --- snooper-19991202.orig/debian/patches/02-Set-baud-rate-correctly.diff +++ snooper-19991202/debian/patches/02-Set-baud-rate-correctly.diff @@ -0,0 +1,53 @@ +Subject: [PATCH] Set baud rate correctly + +Patch by Joe Augst +--- + src/main.c | 28 ++++++++++++++++++++++++++-- + 1 files changed, 26 insertions(+), 2 deletions(-) + +diff --git a/src/main.c b/src/main.c +index 1a0675a..35289c0 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -152,6 +152,30 @@ back: + return p; + } + ++int baud2baudconstant(baud) ++ int baud; ++{ ++ if (baud < 50) return B0; ++ if (baud >= 50 && baud < 75) return B50; ++ if (baud >= 75 && baud < 110) return B75; ++ if (baud >= 110 && baud < 134) return B110; ++ if (baud >= 134 && baud < 150) return B134; ++ if (baud >= 150 && baud < 200) return B150; ++ if (baud >= 200 && baud < 300) return B200; ++ if (baud >= 300 && baud < 600) return B300; ++ if (baud >= 600 && baud < 1200) return B600; ++ if (baud >= 1200 && baud < 1800) return B1200; ++ if (baud >= 1800 && baud < 2400) return B1800; ++ if (baud >= 2400 && baud < 4800) return B2400; ++ if (baud >= 4800 && baud < 9600) return B4800; ++ if (baud >= 9600 && baud < 19200) return B9600; ++ if (baud >= 19200 && baud < 38400) return B19200; ++ if (baud >= 38400 && baud < 57600) return B38400; ++ if (baud >= 57600 && baud < 115200) return B57600; ++ if (baud >= 115200 && baud < 230400) return B115200; ++ if (baud >= 230400) return B230400; ++} ++ + void setbaud(fd, baud) + int fd; + int baud; +@@ -172,8 +196,8 @@ void setbaud(fd, baud) + tio.c_lflag = 0; + tio.c_cc[VMIN] = 1; + tio.c_cc[VTIME] = 5; +- cfsetispeed(&tio, baud); +- cfsetospeed(&tio, baud); ++ cfsetispeed(&tio, baud2baudconstant(baud)); ++ cfsetospeed(&tio, baud2baudconstant(baud)); + if (tcsetattr(fd, TCSANOW, &tio) < 0) { + perror("tcsetattr"); + uucpunlock(n0); --- snooper-19991202.orig/debian/patches/03-Add-HAVE_LIBLOCKDEV-guards.diff +++ snooper-19991202/debian/patches/03-Add-HAVE_LIBLOCKDEV-guards.diff @@ -0,0 +1,51 @@ +Subject: [PATCH] Add HAVE_LIBLOCKDEV guards + +Imported from .diff.gz +--- + src/uucplock.c | 12 ++++++++++++ + 1 files changed, 12 insertions(+), 0 deletions(-) + +diff --git a/src/uucplock.c b/src/uucplock.c +index 2efac71..906f7bc 100644 +--- a/src/uucplock.c ++++ b/src/uucplock.c +@@ -43,6 +43,10 @@ static char sccsid[] = "@(#)uucplock.c 5.5 (Berkeley) 6/1/90"; + + #include "pathnames.h" + ++#ifdef HAVE_LIBLOCKDEV ++#include ++#endif /* HAVE_LIBLOCKDEV */ ++ + /* + * uucp style locking routines + * return: 0 - success +@@ -52,6 +56,9 @@ static char sccsid[] = "@(#)uucplock.c 5.5 (Berkeley) 6/1/90"; + uu_lock(ttyname) + char *ttyname; + { ++#ifdef HAVE_LIBLOCKDEV ++ return((int)dev_lock(ttyname)); ++#else + extern int errno; + int fd, pid; + char tbuf[sizeof(_PATH_LOCKDIRNAME) + MAXNAMLEN]; +@@ -99,13 +106,18 @@ uu_lock(ttyname) + } + (void)close(fd); + return(0); ++#endif /* not HAVE_LIBLOCKDEV */ + } + + uu_unlock(ttyname) + char *ttyname; + { ++#ifdef HAVE_LIBLOCKDEV ++ return((int)dev_unlock(ttyname, getpid())); ++#else + char tbuf[sizeof(_PATH_LOCKDIRNAME) + MAXNAMLEN]; + + (void)snprintf(tbuf, sizeof(tbuf), _PATH_LOCKDIRNAME, ttyname); + return(unlink(tbuf)); ++#endif /* not HAVE_LIBLOCKDEV */ + } --- snooper-19991202.orig/debian/patches/04_hex_and_timestamps.diff +++ snooper-19991202/debian/patches/04_hex_and_timestamps.diff @@ -0,0 +1,176 @@ + + snooper (19991202-4) unstable; urgency=low + + [..] + + - add debian/patches/020_hex_and_timestamps.diff: + Thanks to Cristian Ionescu-Idbohrn , adds + options -x (hex only representation) and -t (write timestamps + in the log file), with corresponding additions to the + snooper man page. + +diff -ubBwpNr snooper-19991202.old/include/extern.h snooper-19991202/include/extern.h +--- snooper-19991202.old/include/extern.h Wed Aug 12 16:31:57 1998 ++++ snooper-19991202/include/extern.h Fri Nov 15 10:31:42 2002 +@@ -3,7 +3,7 @@ int binlog_init __P((int, char *)); + void binlog_write __P((int, char *, int)); + void log_end __P((void)); + int log_init __P((char *)); +-void log_write __P((int, int, char *, int)); ++void log_write __P((int, int, char *, int, unsigned int, unsigned int)); + void log_status __P((int, int, char *)); + void log_memo __P((char *)); + extern int scrn_cols; +diff -ubBwpNr snooper-19991202.old/src/log.c snooper-19991202/src/log.c +--- snooper-19991202.old/src/log.c Mon Feb 23 15:18:30 1998 ++++ snooper-19991202/src/log.c Fri Nov 15 13:57:18 2002 +@@ -11,6 +11,7 @@ + # include + #endif + #include ++#include + + static int log_fd = -1; + #define LOGBUFSIZ 16*1024 +@@ -77,31 +78,47 @@ log_init(name) + } + + /* +- * PUBLIC: void log_write __P((int, int, char *, int)); ++ * PUBLIC: void log_write __P((int, int, char *, int, unsigned int, unsigned int)); + */ + void +-log_write(from, to, buf, len) ++log_write(from, to, buf, len, hex, tofd) + int from; + int to; + char *buf; + int len; ++ unsigned int hex; ++ unsigned int tofd; + { + size_t i; + size_t adv; +- char tbuf[10]; ++ char tbuf[40]; ++ char ct_buf[10] = ""; ++ char tm_buf[30] = ""; ++ struct timeval tv; ++ struct tm *current_time; + + if (log_fd < 0) + return; + + i = 0; + if (log_prevfrom != from || log_prevto != to) { +- sprintf(tbuf, "\n%c>%c: ", from, to); ++ if (tofd == 1) { ++ gettimeofday(&tv, NULL); ++ current_time = localtime(&tv.tv_sec); ++ strftime(ct_buf, sizeof(ct_buf), "%T", current_time); ++ snprintf(tm_buf, ++ sizeof(tm_buf), ++ "%s.%06d: ", ++ ct_buf, ++ tv.tv_usec); ++ } ++ sprintf(tbuf, "\n%s%c>%c: ", tm_buf, from, to); + log_put(tbuf, strlen(tbuf)); + log_prevfrom = from; + log_prevto = to; + } + while (i < len) { +- if (isprint(buf[i])) { ++ if ((hex != 1) && isprint(buf[i])) { + adv = i; + while (isprint(buf[adv]) && adv < len) + adv++; +diff -ubBwpNr snooper-19991202.old/src/main.c snooper-19991202/src/main.c +--- snooper-19991202.old/src/main.c Fri Nov 15 13:52:53 2002 ++++ snooper-19991202/src/main.c Fri Nov 15 10:27:48 2002 +@@ -45,6 +45,10 @@ static int useuucplock = 1; + extern int uu_lock __P((char *)); + extern int uu_unlock __P((char *)); + ++/* representation */ ++static unsigned int hex = 0; ++static unsigned int tofd = 0; ++ + void + daemonuid() + { +@@ -319,7 +323,9 @@ echoback(line, buf, len) + standend(); + echo_x++; + i++; +- } else if (buf[i] != ' ' && isprint(buf[i])) { ++ } else if ((hex == 0) && ++ (buf[i] != ' ') && ++ isprint(buf[i])) { + addch(buf[i]); + echo_x++; + i++; +@@ -669,7 +675,7 @@ mainloop() + len = read(fd0, buf, sizeof(buf)); + incnt0 += len; + echoback(0, buf, len); +- log_write('0', '1', buf, len); ++ log_write('0', '1', buf, len, hex, tofd); + binlog_write(0, buf, len); + write(fd1, buf, len); + } +@@ -677,7 +683,7 @@ mainloop() + len = read(fd1, buf, sizeof(buf)); + incnt1 += len; + echoback(1, buf, len); +- log_write('1', '0', buf, len); ++ log_write('1', '0', buf, len, hex, tofd); + binlog_write(1, buf, len); + write(fd0, buf, len); + } +@@ -720,9 +726,9 @@ gotch: + buf[0] = c; + echoback(consconnect, buf, 1); + if (consconnect == 0) +- log_write('C', '1', buf, 1); ++ log_write('C', '1', buf, 1, hex, tofd); + else +- log_write('C', '0', buf, 1); ++ log_write('C', '0', buf, 1, hex, tofd); + write(consconnect == 0 ? fd1 : fd0, buf, 1); + continue; + } +@@ -738,7 +744,7 @@ end: + binlog_end(1); + } + +-void ++int + main(argc, argv) + int argc; + char **argv; +@@ -752,6 +758,8 @@ main(argc, argv) + useruid(); + + useuucplock = 1; ++ hex = 0; ++ tofd = 0; + + while (--argc > 0 && **++argv == '-') { + for (s = argv[0] + 1; *s != '\0'; s++) { +@@ -731,9 +731,15 @@ main(argc, argv) + s++; + s--; + break; ++ case 't': ++ tofd = 1; ++ break; + case 'u': + useuucplock = 0; + break; ++ case 'x': ++ hex = 1; ++ break; + default: + fprintf(stderr, "unknown option -%c\n", *s); + exit(1); --- snooper-19991202.orig/debian/patches/05_better_input_noforward_help.diff +++ snooper-19991202/debian/patches/05_better_input_noforward_help.diff @@ -0,0 +1,150 @@ + +Here is a patch to make the line input function work better +(uses the standard getnstr(3x) instead of the home made function). +This is also a security patch since the home made function didn't +work correctly if the screen is a bit larger than 80 characters wide. +It also adds two new command line options: -h for some help and +-n for "no forwarding" between the snooped ports (nice if one has +a "splitter cable", a straight serial cable there the TX and RX lines +are also connected to the RX pins of two extra connectors). + + + +diff -rwu snooper-19991202.orig/src/main.c snooper-19991202/src/main.c +--- snooper-19991202.orig/src/main.c Mon Jan 20 14:15:14 2003 ++++ snooper-19991202/src/main.c Mon Jan 20 16:17:18 2003 +@@ -32,6 +32,8 @@ + static int fd0, fd1; + static u_int32_t incnt0, incnt1; + ++static int forward = 1; ++ + /* console */ + static int consconnect; + +@@ -354,63 +356,21 @@ + ask(prompt) + char *prompt; + { +- int c; + static char buf[80]; + char *ret; +- int idx; + int max; +- int y, x; + + move(scrn_rows - 1, 0); + clrtoeol(); + addstr(prompt); + +- idx = 0; + max = scrn_cols - strlen(prompt) - 2; +- while (1) { +- refresh(); +- switch (c = getch()) { +- case '\n': +- case '\r': +- goto gotit; +- case '\033': +- ret = NULL; +- goto quit; +- case '\b': +- if (!idx) { +- scrn_beep(); +- break; +- } +- getyx(stdscr, y, x); +- move(y, x - 1); +- addch(' '); +- move(y, x - 1); +- buf[--idx] = '\0'; +- break; +- case 'U' & 0x1f: +- if (!idx) { +- scrn_beep(); +- break; +- } +- getyx(stdscr, y, x); +- move(y, x - idx); +- clrtoeol(); +- buf[idx = 0] = '\0'; +- break; +- default: +- if (c < ' ' || max <= idx) { +- scrn_beep(); +- break; +- } +- addch(c); +- buf[idx++] = c; +- break; +- } +- } +-gotit: +- buf[idx] = '\0'; ++ if(max > 79) max = 79; ++ echo(); ++ if(getnstr(buf, max) == ERR) goto quit; + ret = buf; + quit: ++ noecho(); + move(scrn_rows - 1, 0); + clrtoeol(); + return ret; +@@ -671,7 +636,7 @@ + echoback(0, buf, len); + log_write('0', '1', buf, len); + binlog_write(0, buf, len); +- write(fd1, buf, len); ++ if(forward) write(fd1, buf, len); + } + if (FD_ISSET(fd1, &rdfd)) { + len = read(fd1, buf, sizeof(buf)); +@@ -679,7 +644,7 @@ + echoback(1, buf, len); + log_write('1', '0', buf, len); + binlog_write(1, buf, len); +- write(fd0, buf, len); ++ if(forward) write(fd0, buf, len); + } + if (FD_ISSET(STDIN_FILENO, &rdfd)) { + if (consconnect == 0 || consconnect == 1) { +@@ -710,6 +710,7 @@ + char **argv; + { + char *s; ++ const char *prgname = argv[0]; + + uid = getuid(); + euid = geteuid(); +@@ -756,6 +722,9 @@ + while (--argc > 0 && **++argv == '-') { + for (s = argv[0] + 1; *s != '\0'; s++) { + switch (*s) { ++ case 'n': ++ forward = 0; ++ break; + case 'b': + baud = atoi(s + 1); + while (*s) +@@ -765,6 +734,14 @@ + case 'u': + useuucplock = 0; + break; ++ case 'h': ++ fprintf(stderr, "%s [-b baudrate] [-t] [-u] [-x] [-n] port0 port1\n" ++ " -t - Include microsecond-timestamps in Log file.\n" ++ " -u - Do not perform serial device locking.\n" ++ " -x - Display all characters as their hex values.\n" ++ " -n - Don't forward between ports.\n" ++ , prgname); ++ break; + default: + fprintf(stderr, "unknown option -%c\n", *s); + exit(1); +@@ -821,5 +796,6 @@ + uucpunlock(n0); + uucpunlock(n1); + scrn_end(); ++ return 0; + } + --- snooper-19991202.orig/debian/patches/06_interactive_command_synopsis.diff +++ snooper-19991202/debian/patches/06_interactive_command_synopsis.diff @@ -0,0 +1,19 @@ +It would be nice if the program had some "online" help to tell the user +which keys to use. + +--- snooper-19991202/src/main.c.orig Mon Jan 20 14:15:14 2003 ++++ snooper-19991202/src/main.c Mon Jan 20 14:11:23 2003 +@@ -504,6 +504,11 @@ + break; + log_memo(tmp); + break; ++ default: ++ move(scrn_rows - 1, 0); ++ clrtoeol(); ++ addstr("uit aud lear og to file " ++ "emo inary log"); + } + + return 1; /*continue execution*/ + + --- snooper-19991202.orig/debian/patches/07_fix_ncurses_linkage.diff +++ snooper-19991202/debian/patches/07_fix_ncurses_linkage.diff @@ -0,0 +1,688 @@ +Description: FTBFS: -ltermcap doesn't work +Author: peter green +Bug-Debian: http://bugs.debian.org/650599 + +Only in snooper-19991202/build: config.guess +Only in snooper-19991202/build: config.sub +Index: snooper-19991202/build/configure +=================================================================== +--- snooper-19991202.orig/build/configure 2011-12-31 21:48:48.000000000 +0000 ++++ snooper-19991202/build/configure 2011-12-31 21:50:45.000000000 +0000 +@@ -1,7 +1,7 @@ + #! /bin/sh + + # Guess values for system-dependent variables and create Makefiles. +-# Generated automatically using autoconf version 2.12 ++# Generated automatically using autoconf version 2.13 + # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. + # + # This configure script is free software; the Free Software Foundation +@@ -51,6 +51,7 @@ + # Initialize some other variables. + subdirs= + MFLAGS= MAKEFLAGS= ++SHELL=${CONFIG_SHELL-/bin/sh} + # Maximum number of lines to put in a shell here document. + ac_max_here_lines=12 + +@@ -334,7 +335,7 @@ + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) +- echo "configure generated by autoconf version 2.12" ++ echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) +@@ -504,9 +505,11 @@ + # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. + ac_cpp='$CPP $CPPFLAGS' + ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' ++ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' + cross_compiling=$ac_cv_prog_cc_cross + ++ac_exeext= ++ac_objext=o + if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then +@@ -543,26 +546,26 @@ + + + # Make sure we can run config.sub. +-if $ac_config_sub sun4 >/dev/null 2>&1; then : ++if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : + else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } + fi + + echo $ac_n "checking host system type""... $ac_c" 1>&6 +-echo "configure:552: checking host system type" >&5 ++echo "configure:555: checking host system type" >&5 + + host_alias=$host + case "$host_alias" in + NONE) + case $nonopt in + NONE) +- if host_alias=`$ac_config_guess`; then : ++ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; + esac + +-host=`$ac_config_sub $host_alias` ++host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` + host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` + host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` + host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +@@ -575,28 +578,30 @@ + # SunOS /usr/etc/install + # IRIX /sbin/install + # AIX /bin/install ++# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag + # AFS /usr/afsws/bin/install, which mishandles nonexistent args + # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" + # ./install, which can be erroneously created by make from ./install.sh. + echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +-echo "configure:583: checking for a BSD compatible install" >&5 ++echo "configure:587: checking for a BSD compatible install" >&5 + if test -z "$INSTALL"; then + if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +- IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" ++ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. +- for ac_prog in ginstall installbsd scoinst install; do ++ # Don't use installbsd from OSF since it installs stuff as root ++ # by default. ++ for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. +- # OSF/1 installbsd also uses dspmsg, but is usable. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" +@@ -626,6 +631,8 @@ + # It thinks the first close brace ends the variable substitution. + test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + ++test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' ++ + test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +@@ -636,7 +643,7 @@ + CC=${CC-cc} + + echo $ac_n "checking if --enable-debug option specified""... $ac_c" 1>&6 +-echo "configure:640: checking if --enable-debug option specified" >&5 ++echo "configure:647: checking if --enable-debug option specified" >&5 + # Check whether --enable-debug or --disable-debug was given. + if test "${enable_debug+set}" = set; then + enableval="$enable_debug" +@@ -658,7 +665,7 @@ + OPTFLAG=${OPTFLAG-"-O"} + + echo $ac_n "checking for tgetstr in -ltermcap""... $ac_c" 1>&6 +-echo "configure:662: checking for tgetstr in -ltermcap" >&5 ++echo "configure:669: checking for tgetstr in -ltermcap" >&5 + ac_lib_var=`echo termcap'_'tgetstr | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -666,7 +673,7 @@ + ac_save_LIBS="$LIBS" + LIBS="-ltermcap $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then ++if { (eval echo configure:688: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -705,15 +712,15 @@ + fi + + echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6 +-echo "configure:709: checking for initscr in -lcurses" >&5 ++echo "configure:716: checking for initscr in -lcurses" >&5 + ac_lib_var=`echo curses'_'initscr | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lcurses -termcap $LIBS" ++LIBS="-lcurses $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then ++if { (eval echo configure:735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -753,25 +760,25 @@ + + + echo $ac_n "checking whether the compiler ($CC $CFLAGS $LDFLAGS) actually works""... $ac_c" 1>&6 +-echo "configure:757: checking whether the compiler ($CC $CFLAGS $LDFLAGS) actually works" >&5 ++echo "configure:764: checking whether the compiler ($CC $CFLAGS $LDFLAGS) actually works" >&5 + + ac_ext=c + # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. + ac_cpp='$CPP $CPPFLAGS' + ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' ++ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' + cross_compiling=$ac_cv_prog_cc_cross + + if test "$cross_compiling" = yes; then + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then ++if { (eval echo configure:782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + am_cv_prog_cc_works=yes + else +@@ -783,11 +790,11 @@ + rm -f conftest* + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + am_cv_prog_cc_works=yes + else +@@ -799,6 +806,12 @@ + rm -fr conftest* + fi + ++ac_ext=c ++# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ++ac_cpp='$CPP $CPPFLAGS' ++ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ++ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' ++cross_compiling=$ac_cv_prog_cc_cross + + case "$am_cv_prog_cc_works" in + *no) { echo "configure: error: Installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } ;; +@@ -808,7 +821,7 @@ + + + echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +-echo "configure:812: checking how to run the C preprocessor" >&5 ++echo "configure:825: checking how to run the C preprocessor" >&5 + # On Suns, sometimes $CPP names a directory. + if test -n "$CPP" && test -d "$CPP"; then + CPP= +@@ -823,14 +836,14 @@ + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:833: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +-ac_err=`grep -v '^ *+' conftest.out` ++{ (eval echo configure:846: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : + else +@@ -840,14 +853,31 @@ + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:850: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +-ac_err=`grep -v '^ *+' conftest.out` ++{ (eval echo configure:863: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then ++ : ++else ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ CPP="${CC-cc} -nologo -E" ++ cat > conftest.$ac_ext < ++Syntax Error ++EOF ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:880: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : + else +@@ -860,6 +890,8 @@ + rm -f conftest* + fi + rm -f conftest* ++fi ++rm -f conftest* + ac_cv_prog_CPP="$CPP" + fi + CPP="$ac_cv_prog_CPP" +@@ -869,12 +901,12 @@ + echo "$ac_t""$CPP" 1>&6 + + echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +-echo "configure:873: checking for ANSI C header files" >&5 ++echo "configure:905: checking for ANSI C header files" >&5 + if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include +@@ -882,8 +914,8 @@ + #include + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:886: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +-ac_err=`grep -v '^ *+' conftest.out` ++{ (eval echo configure:918: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* + ac_cv_header_stdc=yes +@@ -899,7 +931,7 @@ + if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat > conftest.$ac_ext < + EOF +@@ -917,7 +949,7 @@ + if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat > conftest.$ac_ext < + EOF +@@ -938,7 +970,7 @@ + : + else + cat > conftest.$ac_ext < + #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +@@ -949,7 +981,7 @@ + exit (0); } + + EOF +-if { (eval echo configure:953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + : + else +@@ -977,12 +1009,12 @@ + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 +-echo "configure:981: checking for $ac_hdr that defines DIR" >&5 ++echo "configure:1013: checking for $ac_hdr that defines DIR" >&5 + if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include <$ac_hdr> +@@ -990,7 +1022,7 @@ + DIR *dirp = 0; + ; return 0; } + EOF +-if { (eval echo configure:994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:1026: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_dirent_$ac_safe=yes" + else +@@ -1015,7 +1047,7 @@ + # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. + if test $ac_header_dirent = dirent.h; then + echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 +-echo "configure:1019: checking for opendir in -ldir" >&5 ++echo "configure:1051: checking for opendir in -ldir" >&5 + ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -1023,7 +1055,7 @@ + ac_save_LIBS="$LIBS" + LIBS="-ldir $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then ++if { (eval echo configure:1070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -1056,7 +1088,7 @@ + + else + echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 +-echo "configure:1060: checking for opendir in -lx" >&5 ++echo "configure:1092: checking for opendir in -lx" >&5 + ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -1064,7 +1096,7 @@ + ac_save_LIBS="$LIBS" + LIBS="-lx $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then ++if { (eval echo configure:1111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -1101,18 +1133,18 @@ + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:1105: checking for $ac_hdr" >&5 ++echo "configure:1137: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:1115: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +-ac_err=`grep -v '^ *+' conftest.out` ++{ (eval echo configure:1147: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +@@ -1139,12 +1171,12 @@ + + + echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 +-echo "configure:1143: checking for uid_t in sys/types.h" >&5 ++echo "configure:1175: checking for uid_t in sys/types.h" >&5 + if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF +@@ -1173,12 +1205,12 @@ + fi + + echo $ac_n "checking for off_t""... $ac_c" 1>&6 +-echo "configure:1177: checking for off_t" >&5 ++echo "configure:1209: checking for off_t" >&5 + if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #if STDC_HEADERS +@@ -1187,7 +1219,7 @@ + #endif + EOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | +- egrep "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then ++ egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_off_t=yes + else +@@ -1206,12 +1238,12 @@ + fi + + echo $ac_n "checking for size_t""... $ac_c" 1>&6 +-echo "configure:1210: checking for size_t" >&5 ++echo "configure:1242: checking for size_t" >&5 + if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #if STDC_HEADERS +@@ -1220,7 +1252,7 @@ + #endif + EOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | +- egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then ++ egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_size_t=yes + else +@@ -1239,12 +1271,12 @@ + fi + + echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 +-echo "configure:1243: checking whether time.h and sys/time.h may both be included" >&5 ++echo "configure:1275: checking whether time.h and sys/time.h may both be included" >&5 + if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include +@@ -1253,7 +1285,7 @@ + struct tm *tp; + ; return 0; } + EOF +-if { (eval echo configure:1257: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:1289: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_header_time=yes + else +@@ -1277,12 +1309,12 @@ + for ac_func in setreuid + do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:1281: checking for $ac_func" >&5 ++echo "configure:1313: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then ++if { (eval echo configure:1341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else +@@ -1332,12 +1364,12 @@ + for ac_func in select + do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:1336: checking for $ac_func" >&5 ++echo "configure:1368: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then ++if { (eval echo configure:1396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else +@@ -1386,19 +1418,19 @@ + + + echo $ac_n "checking for tigetstr/tigetstr""... $ac_c" 1>&6 +-echo "configure:1390: checking for tigetstr/tigetstr" >&5 ++echo "configure:1422: checking for tigetstr/tigetstr" >&5 + if eval "test \"`echo '$''{'gotch_cv_have_curses_tigetstr'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + tigetstr(0); + ; return 0; } + EOF +-if { (eval echo configure:1402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ++if { (eval echo configure:1434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + gotch_cv_have_curses_tigetstr=yes + else +@@ -1441,7 +1473,7 @@ + # Ultrix sh set writes to stderr and can't be redirected directly, + # and sets the high bit in the cache file unless we assign to the vars. + (set) 2>&1 | +- case `(ac_space=' '; set) 2>&1` in ++ case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). +@@ -1508,7 +1540,7 @@ + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) +- echo "$CONFIG_STATUS generated by autoconf version 2.12" ++ echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; +@@ -1528,9 +1560,11 @@ + s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF + $ac_vpsub + $extrasub ++s%@SHELL@%$SHELL%g + s%@CFLAGS@%$CFLAGS%g + s%@CPPFLAGS@%$CPPFLAGS%g + s%@CXXFLAGS@%$CXXFLAGS%g ++s%@FFLAGS@%$FFLAGS%g + s%@DEFS@%$DEFS%g + s%@LDFLAGS@%$LDFLAGS%g + s%@LIBS@%$LIBS%g +@@ -1555,6 +1589,7 @@ + s%@host_vendor@%$host_vendor%g + s%@host_os@%$host_os%g + s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g ++s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g + s%@INSTALL_DATA@%$INSTALL_DATA%g + s%@CC@%$CC%g + s%@OPTFLAG@%$OPTFLAG%g +Index: snooper-19991202/build/configure.in +=================================================================== +--- snooper-19991202.orig/build/configure.in 2011-12-31 21:48:48.000000000 +0000 ++++ snooper-19991202/build/configure.in 2011-12-31 21:48:51.000000000 +0000 +@@ -29,7 +29,7 @@ + + dnl Checks for libraries. + AC_CHECK_LIB(termcap, tgetstr) +-AC_CHECK_LIB(curses, initscr,,, -termcap) ++AC_CHECK_LIB(curses, initscr) + + dnl Check to see if it's going to work. + AM_SANITY_CHECK_CC --- snooper-19991202.orig/debian/patches/series +++ snooper-19991202/debian/patches/series @@ -0,0 +1,7 @@ +01-Unknown-changes-to-Makefile.in.diff +02-Set-baud-rate-correctly.diff +03-Add-HAVE_LIBLOCKDEV-guards.diff +04_hex_and_timestamps.diff +05_better_input_noforward_help.diff +06_interactive_command_synopsis.diff +07_fix_ncurses_linkage.diff --- snooper-19991202.orig/debian/rules +++ snooper-19991202/debian/rules @@ -0,0 +1,20 @@ +#!/usr/bin/make -f + +%: + dh --with quilt $@ + +override_dh_auto_configure: + cp /usr/share/misc/config.sub build + cp /usr/share/misc/config.guess build + cd build && ./configure --enable-debug --prefix=/usr + +override_dh_auto_build: + $(MAKE) -C build depend + $(MAKE) -C build + +override_dh_auto_install: + $(MAKE) -C build install DESTDIR=$(CURDIR)/debian/snooper + +override_dh_auto_clean: + [ ! -f build/Makefile ] || $(MAKE) -C build distclean + rm -f build/config.sub build/config.guess --- snooper-19991202.orig/debian/snooper.1 +++ snooper-19991202/debian/snooper.1 @@ -0,0 +1,121 @@ +.\" +.\" Copyright(c) 2001, by David Coe. +.\" Freely redistributable under the GNU General Purpose License, +.\" version 2 or later. +.\" +.\" author contact: David Coe +.\" $Id: snooper.1,v 1.4 2005/10/16 06:25:13 david Exp $ +.\" +.Dd Januray 20, 2002 +.Dt SNOOPER 1 +.Os Debian +.Sh NAME +.Nm snooper +.Nd a utility for capturing data flowing between serial devices +.Sh SYNOPSIS +.Nm snooper +.Op Fl h +.Nm snooper +.Op Fl b Ar baudrate +.Op Fl t +.Op Fl u +.Op Fl x +.Op Fl n +.Ar port0 +.Ar port1 +.Sh DESCRIPTION +.Nm snooper +passes data transparently between two serial (RS232C) +devices, capturing and logging the data and occasional comments you +want to insert into the logs. +.Pp +It is useful for debugging or analyzing the communications protocol +between two devices that would normally be connected directly to each +other, e.g. a digital camera and a personal computer. By sitting +in the middle (after you connect the two devices to serial ports +on your Linux machine) snooper is able to capture data traveling in +either direction while also passing it unmodified to the other device. +.Pp +It is also possible to operate with a single serial device, using +your console and keyboard as the second device. +.Sh OPTIONS +.Bl -tag -width indent +.It Fl b Ar baudrate +Specify baudrate to use. +Default baudrate is 9600. +.It Fl t +Include current time (in microseconds) with each write to +the textual log file. See L under KEYBOARD COMMANDS, below. +.It Fl u +Do not perform serial device locking. +(This option is discouraged, and should never be +necessary on a properly-configured Debian system.) +.It Fl x +Hex display only. +(Even printable characters will be displayed in hex.) +.It Fl n +Do not forward traffic between the two ports; useful when +you have a splitter cable. +.It Fl h +Help; presents a brief synopsis of the command line options. +.El +.Sh KEYBOARD COMMANDS +.Nm snooper +has a set of commands that act similar to those of vi. +.Pp +Note that the characters transmitted into the serial ports will +not +be forwarded while +.Nm snooper +is in command parameter input mode. You should therefore set the log +file and so forth while the serial line has no activity. +.Bl -hang -width indent +.It Ic L +Switch textual log file. +You'll be asked to answer the filename of the log file. +.It Ic B +Switch binary log file. +You'll asked to answer which device to log, and the log file name. +Please note that the binary log will contain the +input +from the perspective of +.Nm snooper. +Therefore, if you would like to make +a log of input of line 0 (thus the output from device +connected to line 0), you shold specify line 0. +You should use a file that is local, or on a virtual disk, +so that no characters will be lost. +.It Ic m +add a memo line to the text log file. +The memo line will contain a timestamp and the text you provide. +.It Ic Q +Quit. +.It Ic c +Reset the counter. +.It Ic b +Change the baudrate. +.It Ic C +Make the console act as one of the serial lines. +.Ic ESC +Go back to command mode. +.Ic ^V +Quote the next char (so that you can send +.Ic ESC , +for example). +.Ic ^X +input a byte by its 2-character hexadecimal value (so that you can send +any character you like). +By tapping any other key, that character will be sent to the +line. +.It Ic ^L +Repaint the screen. +.El +An unrecognized command character will present a brief list of the valid command characters. +.Sh EXAMPLE +.Dl snooper /dev/ttyS0 /dev/ttyS1 +.Sh AUTHOR +Jun-ichiro Itoh +.Pp +This man page was written by David Coe +for the Debian project, and may be used by others under the +terms of the GNU General Purpose License, version 2 or later. --- snooper-19991202.orig/debian/watch +++ snooper-19991202/debian/watch @@ -0,0 +1,3 @@ +version=3 +options=uversionmangle=s/^9(\d)/199$1/ \ +ftp://ftp.foretune.co.jp/pub/tools/snooper/snooper[.-](\d+)\.tar\.gz