--- biff-0.17.pre20000412.orig/debian/postinst
+++ biff-0.17.pre20000412/debian/postinst
@@ -0,0 +1,21 @@
+#!/bin/sh -e
+
+if [ "$1" = "configure" ]; then
+ if [ -x /usr/sbin/update-inetd ]; then
+ if grep -q '^biff' /etc/inetd.conf ; then
+ ENABLED=yes
+ else
+ ENABLED=no
+ fi
+ if grep -q 'biff dgram udp wait nobody.mail /usr/sbin/in.comsat comsat' /etc/inetd.conf ; then
+ update-inetd --remove biff
+ fi
+ if [ "$ENABLED" = "yes" ]; then
+ update-inetd --add 'biff dgram udp wait root.tty /usr/sbin/in.comsat comsat'
+ else
+ update-inetd --add '## biff dgram udp wait root.tty /usr/sbin/in.comsat comsat'
+ fi
+
+ fi
+fi
+
--- biff-0.17.pre20000412.orig/debian/README.debian
+++ biff-0.17.pre20000412/debian/README.debian
@@ -0,0 +1,16 @@
+biff for Debian
+---------------
+
+This version of biff was obtained from ftp.uk.linux.org:/pub/linux/Networking.
+It is derived from BSD.
+
+Martin Mitchell
+
+Comsat is disabled by default. To enable it, you need to run as root:
+ update-inetd --enable biff
+
+Be aware that this may be a security risk. You are recommended to firewall
+off the comsat port (512/udp) from remote machines using (e.g.) ipchains
+or iptables.
+
+Dave Holland
--- biff-0.17.pre20000412.orig/debian/changelog
+++ biff-0.17.pre20000412/debian/changelog
@@ -0,0 +1,99 @@
+biff (1:0.17.pre20000412-5) unstable; urgency=low
+
+ * fixed postrm nit when update-inetd not present (closes: 443143)
+
+ -- Dave Holland Fri, 28 Sep 2007 14:57:28 +0100
+
+biff (1:0.17.pre20000412-4) unstable; urgency=low
+
+ * changed suggested alternatives in package description (closes: 440388)
+
+ -- Dave Holland Mon, 3 Sep 2007 08:52:48 +0100
+
+biff (1:0.17.pre20000412-3) unstable; urgency=low
+
+ * removed bashism from debian/rules (closes: #379640)
+ * updated to Standards-Version 3.7.2
+
+ -- Dave Holland Wed, 26 Jul 2006 16:25:15 +0100
+
+biff (1:0.17.pre20000412-2) unstable; urgency=low
+
+ * postinst no longer creates /usr/doc symlink (closes: #322828)
+ * fixed some problems reports by lintian
+
+ -- Dave Holland Mon, 15 Aug 2005 14:26:27 +0100
+
+biff (1:0.17.pre20000412-1.3) unstable; urgency=low
+
+ * correctly handle old inetd.conf entries (closes: #194959)
+
+ -- Dave Holland Wed, 28 May 2003 11:01:51 +0100
+
+biff (1:0.17.pre20000412-1.2) unstable; urgency=low
+
+ * New maintainer (closes: #192668)
+ * Removed reference to "youbin" (closes: #190835)
+ * Check for existence of update-inetd before calling it.
+ (closes: #102780) (closes: #151078) (patch from Moshe Zadka)
+ * include time.h in comsat.c (closes: #124387)
+ (patch from Moshe Zadka)
+ * report mail from correct file (closes: #49936) (comsat now runs
+ as root.tty to allow this)
+
+ -- Dave Holland Mon, 26 May 2003 21:51:17 +0100
+
+biff (1:0.17.pre20000412-1.1) unstable; urgency=low
+
+ * NMU
+ * Check existence of update-inetd before calling it.
+ (Closes: #69343, #88919)
+ * debian/control:
+ - Update standards version.
+ - rewrite package description, discouraging its use
+ * debian/rules: add share/doc/biff -> doc/biff links (Lintian warning)
+ * comsat/comsat.c: include time.h for prototype of time() (Closes: #124387)
+ * Most of these changes came from moshez, see #69343
+
+ -- David Schleef Thu, 20 Jun 2002 15:13:05 -0700
+
+biff (1:0.17.pre20000412-1) unstable; urgency=low
+
+ * New upstream release. (closes: #25828)
+ * Update to standards version 3.1.1.
+
+ -- Martin Mitchell Wed, 26 Apr 2000 01:56:15 +1000
+
+biff (1:0.10-3) unstable; urgency=low
+
+ * Remove problem check from comsat. (Closes: #37719)
+ * Compiled with newer libc6. (Closes: #39016, #37598)
+
+ -- Martin Mitchell Sun, 27 Jun 1999 00:14:15 +1000
+
+biff (1:0.10-2) unstable; urgency=low
+
+ * Update to standards version 2.5.1.
+ * Update copyright file. (#18067)
+ * Libc6.1 compile. (#35426)
+
+ -- Martin Mitchell Tue, 11 May 1999 04:00:19 +1000
+
+biff (1:0.10-1) unstable; urgency=low
+
+ * New upstream source.
+ * Libc6 compile. (#11662)
+ * Add in.comsat manpage. (#6292)
+ * Updated to standards 2.3.0.1.
+ * New maintainer.
+
+ -- Martin Mitchell Mon, 10 Nov 1997 03:22:48 +1100
+
+biff (5.31-1) unstable; urgency=low
+
+ * All pending bugs closed
+ * New maintainer
+ * Version number incremented because of dpkg's questionable handling of epochs
+
+ -- Stephen Pitts Sat, 16 Nov 1996 14:25:16 -0600
+
--- biff-0.17.pre20000412.orig/debian/copyright
+++ biff-0.17.pre20000412/debian/copyright
@@ -0,0 +1,9 @@
+This version of biff was obtained from:
+ftp.uk.linux.org:/pub/linux/Networking/netkit.
+
+It has been packaged by Martin Mitchell who added
+the debian/* files and added miscellaneous patches for compilation.
+Dave Holland made other changes.
+
+The biff package is distributed under the BSD copyright which can be
+found in /usr/share/common-licenses/BSD on a Debian GNU/Linux system.
--- biff-0.17.pre20000412.orig/debian/control
+++ biff-0.17.pre20000412/debian/control
@@ -0,0 +1,26 @@
+Source: biff
+Section: mail
+Priority: extra
+Maintainer: Dave Holland
+Standards-Version: 3.7.2
+
+Package: biff
+Architecture: any
+Depends: ${shlibs:Depends}, netbase
+Description: a mail notification tool
+ biff is a small program that prints a message to your terminal
+ when new email arrives. Actually, the message is printed by
+ the comsat daemon, and biff just enables/disables the u+x
+ permission flag for the terminal, which comsat uses to determine
+ whether or not to write to your terminal.
+ .
+ biff is mainly of historic interest, since there are much better
+ alternatives (such as xlbiff and gbuffy) that are network-aware and
+ do not require a daemon. Although there are no known security
+ problems, running additional services is often considered risky.
+ .
+ By default, the biff service is disabled. To use biff email
+ notification, you must enable this service by running 'update-inetd
+ --enable biff' after the package is installed. You may also need
+ to modify the configuration of your mail transport agent to enable
+ comsat notification.
--- biff-0.17.pre20000412.orig/debian/prerm
+++ biff-0.17.pre20000412/debian/prerm
@@ -0,0 +1,5 @@
+#!/bin/sh
+set -e
+if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/biff ]; then
+ rm -f /usr/doc/biff
+fi
--- biff-0.17.pre20000412.orig/debian/postrm
+++ biff-0.17.pre20000412/debian/postrm
@@ -0,0 +1,9 @@
+#!/bin/sh -e
+
+case "$1" in
+remove)
+ [ -x /usr/sbin/update-inetd ] && update-inetd --remove "biff"
+ ;;
+esac
+
+exit 0
--- biff-0.17.pre20000412.orig/debian/rules
+++ biff-0.17.pre20000412/debian/rules
@@ -0,0 +1,62 @@
+#!/usr/bin/make -f
+# debian.rules file for biff
+# Copyright 2000 by Martin Mitchell.
+
+package=biff
+STRIP=strip
+
+build:
+ $(checkdir)
+ ./configure --installroot=`pwd`/debian/tmp
+ make CFLAGS="-O2 -g -Wall"
+ touch build
+
+clean:
+ $(checkdir)
+ -rm -f build
+ -make distclean
+ -rm `find . -name "*~"`
+ -rm -rf debian/tmp debian/files* debian/substvars core
+
+binary-indep: checkroot build
+ $(checkdir)
+# There are no architecture-independent files to be uploaded
+# generated by this package. If there were any they would be
+# made here.
+
+binary-arch: checkroot build
+ $(checkdir)
+ -rm -rf debian/tmp
+ install -d debian/tmp/usr/bin debian/tmp/usr/sbin debian/tmp/DEBIAN debian/tmp/usr/share/doc/biff debian/tmp/usr/share/man/man1 debian/tmp/usr/share/man/man8
+ make MANDIR=/usr/share/man install
+ install -m 0644 ChangeLog debian/tmp/usr/share/doc/biff
+ cp debian/changelog debian/tmp/usr/share/doc/biff/changelog.Debian
+ gzip -9v debian/tmp/usr/share/doc/biff/*
+ ( cd debian/tmp/usr/share/doc/biff && ln -s ChangeLog.gz changelog.gz )
+ cp debian/copyright debian/tmp/usr/share/doc/biff
+ cp debian/README.debian debian/tmp/usr/share/doc/biff
+ gzip -9v debian/tmp/usr/share/man/man1/*
+ rm debian/tmp/usr/share/man/man8/comsat.8
+ gzip -9v debian/tmp/usr/share/man/man8/*
+ ( cd debian/tmp/usr/share/man/man8 && ln -s in.comsat.8.gz comsat.8.gz )
+ $(STRIP) debian/tmp/usr/bin/biff debian/tmp/usr/sbin/in.comsat
+ install -m 0755 debian/postinst debian/postrm debian/prerm debian/tmp/DEBIAN
+ dpkg-shlibdeps debian/tmp/usr/bin/biff debian/tmp/usr/sbin/in.comsat
+ dpkg-gencontrol -isp
+ chown -R root.root debian/tmp
+ chmod -R go=rX debian/tmp
+ dpkg --build debian/tmp ..
+
+define checkdir
+ test -f debian/rules
+endef
+
+# Below here is fairly generic really
+
+binary: binary-indep binary-arch
+
+checkroot:
+ $(checkdir)
+ test root = "`whoami`"
+
+.PHONY: binary binary-arch binary-indep clean checkroot
--- biff-0.17.pre20000412.orig/comsat/comsat.8
+++ biff-0.17.pre20000412/comsat/comsat.8
@@ -54,7 +54,7 @@
.Xr inetd 8 ) .
The one line messages are of the form:
.Pp
-.Dl user@mailbox-offset
+.Dl user@mailbox-offset:/path/to/mailbox
.Pp
If the
.Em user
--- biff-0.17.pre20000412.orig/comsat/Makefile
+++ biff-0.17.pre20000412/comsat/Makefile
@@ -13,7 +13,7 @@
install: comsat
install -s -m$(DAEMONMODE) comsat $(INSTALLROOT)$(SBINDIR)/in.comsat
install -m$(MANMODE) comsat.8 $(INSTALLROOT)$(MANDIR)/man8/in.comsat.8
- ln -sf in.comsat.8 $(MANDIR)/man8/comsat.8
+ ln -sf in.comsat.8 $(INSTALLROOT)$(MANDIR)/man8/comsat.8
clean:
rm -f *.o comsat
--- biff-0.17.pre20000412.orig/comsat/comsat.c
+++ biff-0.17.pre20000412/comsat/comsat.c
@@ -62,6 +62,7 @@
#include /* used for _PATH_MAILDIR, _PATH_UTMP, etc. */
#include
#include
+#include
#include "../version.h"
@@ -76,8 +77,8 @@
static int nutmp;
static void mailfor(char *name);
-static void notify(struct utmp *utp, off_t offset);
-static void jkfprintf(FILE *, const char *name, off_t offset, const char *cr);
+static void notify(struct utmp *utp, off_t offset, const char *filename);
+static void jkfprintf(FILE *, const char *name, off_t offset, const char *cr, const char *filename);
static void onalrm(int);
int main(void) {
@@ -274,18 +275,26 @@
struct utmp *utp;
char *cp;
off_t offset;
+ char *filename;
+
+ dsyslog(LOG_DEBUG, "mailfor: %s\n", name);
/* Break off the file offset part and convert it to an integer. */
cp = strchr(name, '@');
if (!cp) return;
*cp = 0;
- offset = atol(cp + 1);
+ offset = strtol(cp + 1, &filename, 10);
+ /* if(*filename != '\0')
+ return; */
+
+ if(*filename == ':')
+ filename++;
/* Look through the utmp and call notify() for each matching login. */
utp = &utmp[nutmp];
while (--utp >= utmp) {
if (!strncmp(utp->ut_name, name, sizeof(utmp[0].ut_name)))
- notify(utp, offset);
+ notify(utp, offset, filename);
}
}
@@ -313,7 +322,7 @@
/*
* This actually writes to the user's terminal.
*/
-static void notify(struct utmp *utp, off_t offset)
+static void notify(struct utmp *utp, off_t offset, const char *filename)
{
FILE *tp; /* file open on tty */
struct stat stb;
@@ -426,7 +435,7 @@
/*
* Print the first few lines of the message.
*/
- jkfprintf(tp, name, offset, cr);
+ jkfprintf(tp, name, offset, cr, filename);
/*
* Close up and quit the child process.
@@ -439,7 +448,7 @@
* This prints a few lines from the mailbox of the user "name" at offset
* "offset", using "cr" as the line break string, to the file "tp".
*/
-static void jkfprintf(FILE *tp, const char *name, off_t offset, const char *cr)
+static void jkfprintf(FILE *tp, const char *name, off_t offset, const char *cr, const char * filename)
{
char *cp, ch;
FILE *fi;
@@ -469,8 +478,11 @@
/*
* Open the user's mailbox (recall we're already in the mail spool dir)
*/
- fi = fopen(name, "r");
- if (fi == NULL) return;
+ fi = fopen(filename, "r");
+ if (fi == NULL) {
+ dsyslog(LOG_DEBUG, "couldn't open mailbox %s\n", filename);
+ return;
+ }
/* Move to requested offset */
fseek(fi, offset, L_SET);