--- debathena-discuss-10.0.8.orig/aclocal.m4
+++ debathena-discuss-10.0.8/aclocal.m4
@@ -79,7 +79,7 @@
 		CPPFLAGS="$CPPFLAGS -I$com_err/include"
 		LDFLAGS="$LDFLAGS -L$com_err/lib"
 	fi
-	AC_CHECK_LIB(com_err, com_err, :,
+	AC_CHECK_LIB(com_err, com_err, ,
 		     [AC_MSG_ERROR(com_err library not found)])
 else
 	AC_MSG_ERROR(This package requires com_err.)
@@ -98,7 +98,7 @@
 	fi
 	AC_CHECK_LIB(curses, initscr)
 	AC_CHECK_LIB(readline, readline)
-	AC_CHECK_LIB(ss, ss_perror, :,
+	AC_CHECK_LIB(ss, ss_perror, ,
 		     [AC_MSG_ERROR(ss library not found)], -lcom_err)
 else
 	AC_MSG_ERROR(This package requires ss.)
--- debathena-discuss-10.0.8.orig/debian/copyright
+++ debathena-discuss-10.0.8/debian/copyright
@@ -0,0 +1,23 @@
+This package was debianized as part of the Debathena Project
+<http://debathena.mit.edu/> of the MIT Student Information Processing
+Board.
+
+The Athena source code was obtained from the Athena SVN repository at
+<svn://debathena.mit.edu/athena/trunk>, and is licensed as follows:
+
+  Copyright © 1996 by the Massachusetts Institute of Technology.
+
+  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 M.I.T. not be used in
+  advertising or publicity pertaining to distribution of the
+  software without specific, written prior permission.
+  M.I.T. makes no representations about the suitability of
+  this software for any purpose.  It is provided "as is"
+  without express or implied warranty.
+
+The Debian packaging is Copyright © 2007-2008 Tim Abbott and Anders
+Kaseorg, and has the same license as the original software.
--- debathena-discuss-10.0.8.orig/debian/control.in
+++ debathena-discuss-10.0.8/debian/control.in
@@ -0,0 +1,59 @@
+Source: debathena-discuss
+Section: debathena/net
+Priority: extra
+Maintainer: Debathena Project <debathena@mit.edu>
+Build-Depends: @cdbs@, comerr-dev, ss-dev, libkrb5-dev, libzephyr-dev, libzephyr3-krb, bison
+Standards-Version: 3.7.2
+
+Package: debathena-discuss
+Architecture: any
+Provides: discuss
+Depends: ${shlibs:Depends}, ${misc:Depends}, tcsh | c-shell, netbase
+Description: A conferencing and mail archiving system
+ Discuss is a user-interface front end to a networked conferencing 
+ system.
+
+Package: debathena-discuss-emacs
+Architecture: all
+Provides: discuss-emacs
+Depends: ${shlibs:Depends}, ${misc:Depends}, debathena-discuss (>= ${source:Version}), emacs | emacsen
+Description: Emacs interface to discuss
+ Discuss is a user-interface front end to a networked conferencing 
+ system.
+ .
+ This package contains an Emacs interface to discuss.
+
+Package: debathena-discuss-server
+Architecture: any
+Provides: discuss-server
+Pre-Depends: adduser
+Depends: ${shlibs:Depends}, ${misc:Depends}, debathena-discuss (= ${binary:Version}), netbase, openbsd-inetd | inet-superserver
+Description: A conferencing and mail archiving system
+ Discuss is a user-interface front end to a networked conferencing 
+ system.
+ .
+ This package contains the discuss server.
+
+Package: debathena-libdsk-dev
+Section: debathena/libdevel
+Architecture: any
+Provides: libdsk-dev
+Depends: ${shlibs:Depends}, ${misc:Depends}, debathena-libusp-dev (= ${binary:Version}), comerr-dev, libkrb5-dev
+Description: Development files for discuss library
+ Discuss is a user-interface front end to a networked conferencing 
+ system.
+ .
+ This package contains libdsk headers and static libraries for 
+ development.
+
+Package: debathena-libusp-dev
+Section: debathena/libdevel
+Architecture: any
+Provides: libusp-dev
+Depends: ${shlibs:Depends}, ${misc:Depends}, comerr-dev
+Description: Development files for UNIX Unified Stream Protocol library
+ Discuss is a user-interface front end to a networked conferencing 
+ system.
+ .
+ This package contains libusp headers and static libraries for 
+ development.
--- debathena-discuss-10.0.8.orig/debian/compat
+++ debathena-discuss-10.0.8/debian/compat
@@ -0,0 +1 @@
+4
--- debathena-discuss-10.0.8.orig/debian/changelog
+++ debathena-discuss-10.0.8/debian/changelog
@@ -0,0 +1,127 @@
+debathena-discuss (10.0.8-0debathena1) unstable; urgency=low
+
+  * Add one-character aliases to discuss. Patch by Ben Kaduk. (Trac: #238)
+  * Squash some lintian warnings by switching from ${Source-Version} to
+    ${source:Version} and ${binary:Version}
+  * Use HAVE_KRB4 and HAVE_KRB5 instead of KERBEROS and KERBEROS5.
+  * Assorted changes to make discuss work with any combination of krb4 and
+    krb5 (including neither).
+  * Always build our discuss with krb5.
+
+ -- Evan Broder <broder@mit.edu>  Mon, 18 May 2009 23:51:52 -0400
+
+debathena-discuss (10.0.7-0debathena3) unstable; urgency=low
+
+  * Configure the discuss inetd service.
+
+ -- Evan Broder <broder@mit.edu>  Thu, 05 Mar 2009 15:17:20 -0500
+
+debathena-discuss (10.0.7-0debathena2) unstable; urgency=low
+
+  * Change DEB_AUTO_UPDATE_AUTOCONF to 2.50, not 1.
+  * Remove DEB_AUTO_UPDATE_DEBIAN_CONTROL.
+  * Change "Debian-Athena Project" to "Debathena Project".
+  * Remove debian/control from version control.
+  * Clean up debian/copyright.
+
+ -- Tim Abbott <tabbott@mit.edu>  Sat, 24 Jan 2009 14:31:41 -0500
+
+debathena-discuss (10.0.7-0debathena1) unstable; urgency=low
+
+  * Revert a small part of the OS X com_err patch from 10.0.6 in favor of
+    changes to aclocal.m4
+  * Remove hard-coded paths from discuss-mode, in favor of getting them
+    from autoconf.
+  * Remove debathena-machtype as a dependency, as it's no longer needed.
+
+ -- Evan Broder <broder@mit.edu>  Fri, 09 Jan 2009 21:47:33 -0500
+
+debathena-discuss (10.0.6-0debathena1) unstable; urgency=low
+
+  [ Evan Broder ]
+  * Add com_err support for delete and discuss on OS X.
+
+  [ Anders Kaseorg ]
+  * Depend emacs | emacsen instead of emacs22 | emacs21 | emacsen, so that
+    the emacs metapackage is pulled in by default.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Thu, 08 Jan 2009 16:35:04 -0500
+
+debathena-discuss (10.0.5-0debathena1) unstable; urgency=low
+
+  * Fix some trivial typos.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Tue, 19 Aug 2008 16:35:07 -0400
+
+debathena-discuss (10.0.4-0debathena1) unstable; urgency=low
+
+  * Fix a crash bug in edsc on 64-bit platforms.
+  * Fix date display in discuss on 64-bit platforms.
+
+ -- Greg Hudson <ghudson@mit.edu>  Mon, 30 Jun 2008 12:50:56 -0400
+
+debathena-discuss (10.0.3-0debathena1) unstable; urgency=low
+
+  * Fix a crash bug in edsc (int/long mismatch in short_time).
+  * Put edsc crash dumps in /tmp instead of /usr/tmp.
+
+ -- Greg Hudson <ghudson@mit.edu>  Wed, 11 Jun 2008 19:39:38 -0400
+
+debathena-discuss (10.0.2-0debathena1) unstable; urgency=low
+
+  * Stop assuming that long is 32 bits.
+  * Start assuming that int is 32 bits.
+
+ -- Greg Hudson <ghudson@mit.edu>  Wed, 11 Jun 2008 16:29:35 -0400
+
+debathena-discuss (10.0.1-0debathena1) unstable; urgency=low
+
+  * Fix obsolete names for Kerberos library functions, which no longer
+    worked on Mac OS X.  Patch from broder.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Sun, 06 Apr 2008 19:25:13 -0400
+
+debathena-discuss (10.0.0-0debathena2) unstable; urgency=low
+
+  * Actually use SERVERDIR, BINDIR, and INFODIR in config.h.sed.  (The
+    Makefile already interpolates these variables.)
+
+ -- Anders Kaseorg <andersk@mit.edu>  Sun, 06 Apr 2008 17:28:52 -0400
+
+debathena-discuss (10.0.0-0debathena1) unstable; urgency=low
+
+  * Merged quilt patches into mainline Athena tree
+
+ -- Shreevatsa R <vatsa@mit.edu>  Sun,  6 Apr 2008 15:54:22 -0400
+
+debathena-discuss (9.4.41-0debathena2) unstable; urgency=low
+
+  * Add emacs22 as a default alternative to emacs21 | emacsen.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Mon, 29 Oct 2007 21:40:29 -0400
+
+debathena-discuss (9.4.41-0debathena1) unstable; urgency=low
+
+  * New upstream release supporting Kerberos 5.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Thu, 23 Aug 2007 14:28:28 -0400
+
+debathena-discuss (9.4.30-0debathena3) unstable; urgency=low
+
+  * Section: debathena/net.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Tue, 17 Jul 2007 06:33:41 -0400
+
+debathena-discuss (9.4.30-0debathena2) unstable; urgency=low
+
+  * Move edsc to debathena-discuss package.
+  * Don't link libreadline, because libss is stupid and tries to do so at
+    runtime.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Tue, 17 Jul 2007 03:37:48 -0400
+
+debathena-discuss (9.4.30-0debathena1) unstable; urgency=low
+
+  * Initial release.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Tue, 30 Jan 2007 22:57:54 -0500
--- debathena-discuss-10.0.8.orig/debian/debathena-discuss-emacs.install
+++ debathena-discuss-10.0.8/debian/debathena-discuss-emacs.install
@@ -0,0 +1 @@
+usr/share/emacs/site-lisp/*.el
--- debathena-discuss-10.0.8.orig/debian/debathena-discuss-emacs.emacsen-remove
+++ debathena-discuss-10.0.8/debian/debathena-discuss-emacs.emacsen-remove
@@ -0,0 +1,10 @@
+#!/bin/sh -e
+# /usr/lib/emacsen-common/packages/remove/debathena-discuss-emacs
+
+FLAVOR=$1
+PACKAGE=debathena-discuss-emacs
+
+if [ ${FLAVOR} != emacs ]; then
+    echo remove/${PACKAGE}: purging byte-compiled files for ${FLAVOR}
+    rm -rf /usr/share/${FLAVOR}/site-lisp/${PACKAGE}
+fi
--- debathena-discuss-10.0.8.orig/debian/control
+++ debathena-discuss-10.0.8/debian/control
@@ -0,0 +1,59 @@
+Source: debathena-discuss
+Section: debathena/net
+Priority: extra
+Maintainer: Debathena Project <debathena@mit.edu>
+Build-Depends: cdbs (>= 0.4.23-1.1), autotools-dev, debhelper (>= 4.2.0), autoconf, comerr-dev, ss-dev, libkrb5-dev, libzephyr-dev, libzephyr3-krb, bison
+Standards-Version: 3.7.2
+
+Package: debathena-discuss
+Architecture: any
+Provides: discuss
+Depends: ${shlibs:Depends}, ${misc:Depends}, tcsh | c-shell, netbase
+Description: A conferencing and mail archiving system
+ Discuss is a user-interface front end to a networked conferencing 
+ system.
+
+Package: debathena-discuss-emacs
+Architecture: all
+Provides: discuss-emacs
+Depends: ${shlibs:Depends}, ${misc:Depends}, debathena-discuss (>= ${source:Version}), emacs | emacsen
+Description: Emacs interface to discuss
+ Discuss is a user-interface front end to a networked conferencing 
+ system.
+ .
+ This package contains an Emacs interface to discuss.
+
+Package: debathena-discuss-server
+Architecture: any
+Provides: discuss-server
+Pre-Depends: adduser
+Depends: ${shlibs:Depends}, ${misc:Depends}, debathena-discuss (= ${binary:Version}), netbase, openbsd-inetd | inet-superserver
+Description: A conferencing and mail archiving system
+ Discuss is a user-interface front end to a networked conferencing 
+ system.
+ .
+ This package contains the discuss server.
+
+Package: debathena-libdsk-dev
+Section: debathena/libdevel
+Architecture: any
+Provides: libdsk-dev
+Depends: ${shlibs:Depends}, ${misc:Depends}, debathena-libusp-dev (= ${binary:Version}), comerr-dev, libkrb5-dev
+Description: Development files for discuss library
+ Discuss is a user-interface front end to a networked conferencing 
+ system.
+ .
+ This package contains libdsk headers and static libraries for 
+ development.
+
+Package: debathena-libusp-dev
+Section: debathena/libdevel
+Architecture: any
+Provides: libusp-dev
+Depends: ${shlibs:Depends}, ${misc:Depends}, comerr-dev
+Description: Development files for UNIX Unified Stream Protocol library
+ Discuss is a user-interface front end to a networked conferencing 
+ system.
+ .
+ This package contains libusp headers and static libraries for 
+ development.
--- debathena-discuss-10.0.8.orig/debian/rules
+++ debathena-discuss-10.0.8/debian/rules
@@ -0,0 +1,13 @@
+#!/usr/bin/make -f
+
+DEB_AUTO_UPDATE_AUTOCONF = 2.50
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/autotools.mk
+
+DEB_CONFIGURE_EXTRA_FLAGS += --with-krb4=$(shell krb5-config --prefix krb4) --with-krb5 --with-zephyr
+DEB_MAKE_CLEAN_TARGET = clean
+DEB_DH_INSTALL_SOURCEDIR = $(DEB_DESTDIR)
+
+clean::
+	find . -name Makefile -exec rm -f {} \;
+	rm -f client/cmds.c config.status config.log configure
--- debathena-discuss-10.0.8.orig/debian/debathena-discuss-emacs.emacsen-startup
+++ debathena-discuss-10.0.8/debian/debathena-discuss-emacs.emacsen-startup
@@ -0,0 +1,24 @@
+;; -*-emacs-lisp-*-
+;;
+;; Emacs startup file, e.g.  /etc/emacs/site-start.d/50debathena-discuss-emacs.el
+;; for the Debian debathena-discuss-emacs package
+;;
+;; Originally contributed by Nils Naumann <naumann@unileoben.ac.at>
+;; Modified by Dirk Eddelbuettel <edd@debian.org>
+;; Adapted for dh-make by Jim Van Zandt <jrv@debian.org>
+
+;; The debathena-discuss-emacs package follows the Debian/GNU Linux 'emacsen' policy and
+;; byte-compiles its elisp files for each 'emacs flavor' (emacs19,
+;; xemacs19, emacs20, xemacs20...).  The compiled code is then
+;; installed in a subdirectory of the respective site-lisp directory.
+;; We have to add this to the load-path:
+(let ((package-dir (concat "/usr/share/"
+                           (symbol-name flavor)
+                           "/site-lisp/debathena-discuss-emacs")))
+;; If package-dir does not exist, the debathena-discuss-emacs package must have
+;; removed but not purged, and we should skip the setup.
+  (when (file-directory-p package-dir)
+        (setq load-path (cons package-dir load-path))
+       (autoload 'discuss "discuss"
+           "Enter discuss mode for emacs and list meetings." t)))
+
--- debathena-discuss-10.0.8.orig/debian/debathena-libusp-dev.install
+++ debathena-discuss-10.0.8/debian/debathena-libusp-dev.install
@@ -0,0 +1,2 @@
+usr/include/usp
+usr/lib/libusp.a
--- debathena-discuss-10.0.8.orig/debian/debathena-discuss-server.dirs
+++ debathena-discuss-10.0.8/debian/debathena-discuss-server.dirs
@@ -0,0 +1 @@
+var/spool/discuss
--- debathena-discuss-10.0.8.orig/debian/debathena-discuss-emacs.emacsen-install
+++ debathena-discuss-10.0.8/debian/debathena-discuss-emacs.emacsen-install
@@ -0,0 +1,38 @@
+#! /bin/sh -e
+# /usr/lib/emacsen-common/packages/install/debathena-discuss-emacs
+
+# Written by Jim Van Zandt <jrv@debian.org>, borrowing heavily
+# from the install scripts for gettext by Santiago Vila
+# <sanvila@ctv.es> and octave by Dirk Eddelbuettel <edd@debian.org>.
+
+FLAVOR=$1
+PACKAGE=debathena-discuss-emacs
+
+if [ ${FLAVOR} = emacs ]; then exit 0; fi
+
+echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR}
+
+#FLAVORTEST=`echo $FLAVOR | cut -c-6`
+#if [ ${FLAVORTEST} = xemacs ] ; then
+#    SITEFLAG="-no-site-file"
+#else
+#    SITEFLAG="--no-site-file"
+#fi
+FLAGS="${SITEFLAG} -q -batch -l path.el -f batch-byte-compile"
+
+ELDIR=/usr/share/emacs/site-lisp
+ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}
+
+install -m 755 -d ${ELCDIR}
+cd ${ELDIR}
+FILES=`echo discuss*.el`
+cp ${FILES} ${ELCDIR}
+cd ${ELCDIR}
+
+cat << EOF > path.el
+(setq load-path (cons "." load-path) byte-compile-warnings nil)
+EOF
+${FLAVOR} ${FLAGS} ${FILES}
+rm -f *.el path.el
+
+exit 0
--- debathena-discuss-10.0.8.orig/debian/debathena-discuss.install
+++ debathena-discuss-10.0.8/debian/debathena-discuss.install
@@ -0,0 +1,12 @@
+usr/bin/crmtgs
+usr/bin/discuss
+usr/bin/dsc_setup
+usr/bin/dsgrep
+usr/bin/dsmail
+usr/bin/dspipe
+usr/bin/mkds
+usr/bin/pmtg
+usr/bin/rmds
+usr/lib/debathena-discuss/edsc
+usr/share/discuss
+usr/share/man/man1/*.1
--- debathena-discuss-10.0.8.orig/debian/debathena-discuss-server.install
+++ debathena-discuss-10.0.8/debian/debathena-discuss-server.install
@@ -0,0 +1,3 @@
+usr/bin/create_mtg_dir
+usr/sbin/discussd
+usr/sbin/disserve
--- debathena-discuss-10.0.8.orig/debian/debathena-libdsk-dev.install
+++ debathena-discuss-10.0.8/debian/debathena-libdsk-dev.install
@@ -0,0 +1,2 @@
+usr/include/discuss
+usr/lib/libdsk.a
--- debathena-discuss-10.0.8.orig/debian/debathena-discuss.postinst
+++ debathena-discuss-10.0.8/debian/debathena-discuss.postinst
@@ -0,0 +1,46 @@
+#!/bin/sh
+# postinst script for debathena-discuss
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <postinst> `abort-remove'
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    configure)
+	if ! grep -q '^discuss[[:space:]]' /etc/services; then
+	    cat <<EOF >>/etc/services
+discuss		2100/tcp			# Networked conferencing.
+EOF
+	fi
+	;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+	;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
--- debathena-discuss-10.0.8.orig/debian/debathena-discuss-server.postinst
+++ debathena-discuss-10.0.8/debian/debathena-discuss-server.postinst
@@ -0,0 +1,55 @@
+#!/bin/sh
+# postinst script for debathena-discuss
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <postinst> `abort-remove'
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    configure)
+	if ! grep -q '^discuss[[:space:]]' /etc/services; then
+	    echo "Discuss		2100/tcp			# Networked conferencing." >>/etc/services
+	fi
+        update-inetd --add "discuss\tstream\ttcp\tnowait\tdiscuss\t/usr/sbin/discussd"
+	if ! getent passwd discuss >/dev/null; then
+	    adduser --system --no-create-home --disabled-password --home /var/spool/discuss --gecos "Discuss server" --group discuss
+	fi
+	if ! dpkg-statoverride --list /usr/sbin/disserve >/dev/null; then
+	    chown discuss:discuss /usr/sbin/disserve
+	    chmod a=rx,u+ws /usr/sbin/disserve
+	fi
+	if ! dpkg-statoverride --list /var/spool/discuss >/dev/null; then
+	    chown discuss:discuss /var/spool/discuss
+	fi
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
--- debathena-discuss-10.0.8.orig/debian/debathena-discuss-server.prerm
+++ debathena-discuss-10.0.8/debian/debathena-discuss-server.prerm
@@ -0,0 +1,44 @@
+#!/bin/sh
+# prerm script for #PACKAGE#
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <prerm> `remove'
+#        * <old-prerm> `upgrade' <new-version>
+#        * <new-prerm> `failed-upgrade' <old-version>
+#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
+#        * <deconfigured's-prerm> `deconfigure' `in-favour'
+#          <package-being-installed> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    remove)
+        update-inetd --disable discuss
+    ;;
+
+    upgrade|deconfigure)
+        ;;
+
+    failed-upgrade)
+    ;;
+
+    *)
+        echo "prerm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
--- debathena-discuss-10.0.8.orig/debian/debathena-discuss-server.postrm
+++ debathena-discuss-10.0.8/debian/debathena-discuss-server.postrm
@@ -0,0 +1,51 @@
+#!/bin/sh
+# postrm script for debathena-discuss-server
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postrm> `remove'
+#        * <postrm> `purge'
+#        * <old-postrm> `upgrade' <new-version>
+#        * <new-postrm> `failed-upgrade' <old-version>
+#        * <new-postrm> `abort-install'
+#        * <new-postrm> `abort-install' <old-version>
+#        * <new-postrm> `abort-upgrade' <old-version>
+#        * <disappearer's-postrm> `disappear' <overwriter>
+#          <overwriter-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    purge)
+	if getent passwd discuss >/dev/null; then
+	    deluser --system discuss || :
+	fi
+    ;;
+
+    remove)
+        if hash update-inetd 2>/dev/null; then
+            update-inetd --remove "(#<off># )?discuss"
+        fi
+    ;;
+
+    upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+    ;;
+
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
--- debathena-discuss-10.0.8.orig/dsgrep/regerror.c
+++ debathena-discuss-10.0.8/dsgrep/regerror.c
@@ -13,6 +13,7 @@
 #endif
 
 #include <stdio.h>
+#include <stdlib.h>
 void regerror(msg)
      char *msg;
 {
--- debathena-discuss-10.0.8.orig/server/Makefile.in
+++ debathena-discuss-10.0.8/server/Makefile.in
@@ -74,7 +74,7 @@
 		$(LIBS) $(LDLIBS)
 
 rpproc.k.o: rpproc.c
-	${CC} ${ALL_CFLAGS} -DINETD -DKERBEROS5 -DKERBEROS -c rpproc.c
+	${CC} ${ALL_CFLAGS} -DINETD -c rpproc.c
 	mv rpproc.o rpproc.k.o
 
 rpproc.nk.o: rpproc.c
@@ -82,11 +82,11 @@
 	mv rpproc.o rpproc.nk.o
 
 rpproc.debug.o: rpproc.c
-	${CC} ${ALL_CFLAGS} -DKERBEROS5 -DKERBEROS -c rpproc.c
+	${CC} ${ALL_CFLAGS} -c rpproc.c
 	mv rpproc.o rpproc.debug.o
 
 core.o: core.c
-	${CC} ${ALL_CFLAGS} -DKERBEROS5 -DKERBEROS -c core.c
+	${CC} ${ALL_CFLAGS} -c core.c
 
 coreutil.o: coreutil.c
-	${CC} ${ALL_CFLAGS} -DKERBEROS5 -DKERBEROS -c coreutil.c
+	${CC} ${ALL_CFLAGS} -c coreutil.c
--- debathena-discuss-10.0.8.orig/server/rpproc.c
+++ debathena-discuss-10.0.8/server/rpproc.c
@@ -44,10 +44,10 @@
 #include <errno.h>
 #include <pwd.h>
 #include <string.h>
-#ifdef KERBEROS
+#ifdef HAVE_KRB4
 #include <krb.h>
 #endif
-#ifdef KERBEROS5
+#ifdef HAVE_KRB5
 #include <krb5.h>
 #endif
 #include <discuss/tfile.h>
@@ -60,7 +60,7 @@
 #define min(a, b) (a < b ? a : b)
 
 /* global */
-#ifdef KERBEROS
+#ifdef HAVE_KRB4
 char rpc_caller[MAX_K_NAME_SZ + 1];
 #else
 char rpc_caller[50];
@@ -69,9 +69,9 @@
 
 extern int numprocs;
 extern struct proc_table procs [];
-#ifdef KERBEROS
+#ifdef HAVE_KRB4
 static char serv_name[20];
-#endif /* KERBEROS */
+#endif /* HAVE_KRB4 */
 short recvshort();
 int rpc_err;
 extern tfile net_tfile ();
@@ -108,7 +108,7 @@
     int s;
 #endif
     
-#ifdef KERBEROS
+#ifdef HAVE_KRB4
     int fromlen,i;
     struct sockaddr_in from;
     char hostname[50];
@@ -206,7 +206,7 @@
     strcat (rpc_caller, "@");
     strcat (rpc_caller, REALM);
     
-#ifdef KERBEROS
+#ifdef HAVE_KRB4
 
     strcpy(serv_name, service);
     fromlen = sizeof (from);
@@ -235,7 +235,7 @@
     return;
 }
 
-#ifdef KERBEROS
+#ifdef HAVE_KRB4
 handle_kerberos(bt,service,haddr)
 USPCardinal bt;
 char *service;
@@ -248,7 +248,7 @@
     AUTH_DAT kdata;
     KTEXT_ST ticket;
 
-#ifdef KERBEROS5
+#ifdef HAVE_KRB5
     char *envvar;
     krb5_context context;
     krb5_auth_context auth_context = NULL;
@@ -256,7 +256,7 @@
     krb5_principal sprinc;
     krb5_keytab keytab = NULL;
     krb5_ticket *processed_ticket = NULL;
-#endif /* KERBEROS5 */
+#endif /* HAVE_KRB5 */
 
     strcpy (rpc_caller, "???@");		/* safety drop */
     strcat (rpc_caller, REALM);
@@ -270,7 +270,7 @@
     for (i=0; i<ticket.length; i++) {
 	ticket.dat[i] = recvshort();
     }
-#ifdef KERBEROS5
+#ifdef HAVE_KRB5
     packet.length = ticket.length;
     packet.data = (krb5_pointer) ticket.dat;
     
@@ -279,7 +279,7 @@
 	sprintf(envvar, "KRB5_KTNAME=/var/spool/%s/krb5.keytab", service);
 	putenv(envvar);
     }
-#endif /* KERBEROS5 */
+#endif /* HAVE_KRB5 */
     /* make filename from service */
     strcpy (filename, "/var/spool/");
     strcat (filename, service);
@@ -287,7 +287,7 @@
 
     strcpy(instance, "*");
 
-#ifdef KERBEROS5
+#ifdef HAVE_KRB5
     result = krb5_init_context(&context);
     if (result) {
         com_err(service, result, "while initializing krb5");
@@ -314,16 +314,16 @@
     else {  /* Let's try krb4 */
 	/* First, log the krb5 error. */
 	com_err(service, result, "while reading request");
-#endif /* KERBEROS5 */
+#endif /* HAVE_KRB5 */
         result = krb_rd_req (&ticket, service, instance, haddr, &kdata,
 	                     filename);
 	if (result) {
 	    result += ERROR_TABLE_BASE_krb;
 	    goto punt_kerberos;
 	}
-#ifdef KERBEROS5
+#ifdef HAVE_KRB5
     }
-#endif /* KERBEROS5 */
+#endif /* HAVE_KRB5 */
 
     strcpy(rpc_caller, kdata.pname);
     if (kdata.pinst[0] != '\0') {
@@ -341,7 +341,7 @@
 	 USP_end_block(us);
     }
 }
-#endif /* KERBEROS */
+#endif /* HAVE_KRB4 */
 
 /*
  *
@@ -362,13 +362,13 @@
 	return;
     }
 
-#ifdef KERBEROS
+#ifdef HAVE_KRB4
     if (bt == KRB_TICKET || bt == KRB_TICKET2) {
 	 handle_kerberos(bt, serv_name, hostaddr);
 	 *code = 0;
 	 return;
     }
-#endif /* KERBEROS */
+#endif /* HAVE_KRB4 */
 
     procno = bt - PROC_BASE;
 
--- debathena-discuss-10.0.8.orig/ets/discuss_err.et
+++ debathena-discuss-10.0.8/ets/discuss_err.et
@@ -32,4 +32,7 @@
 	ec	DISC_ACTION_NOT_PERFORMED,
 		"Action not performed"
 
+	ec	DISC_NO_KRB,
+		"No Kerberos support built in"
+
 	end
--- debathena-discuss-10.0.8.orig/ets/rpc_et.et
+++ debathena-discuss-10.0.8/ets/rpc_et.et
@@ -36,4 +36,7 @@
 	ec	RPC_NO_ADDR,
 		"Host has no network address"
 
+	ec	RPC_SERVER_TOO_OLD,
+		"RPC server too old"
+
 	end
--- debathena-discuss-10.0.8.orig/mclient/Makefile.in
+++ debathena-discuss-10.0.8/mclient/Makefile.in
@@ -61,7 +61,7 @@
 	${CC} ${LDFLAGS} -o pmtg pmtg.o ../ets/dsc_et.o ${KLIBS}
 
 dsmail: dsmail.o ../ets/dsc_et.o
-	${CC} ${LDFLAGS} -o dsmail dsmail.o ../ets/dsc_et.o ${NKLIBS}
+	${CC} ${LDFLAGS} -o dsmail dsmail.o ../ets/dsc_et.o ${KLIBS}
 
 dspipe: dspipe.o ../ets/dsc_et.o
 	${CC} ${LDFLAGS} -o dspipe dspipe.o ../ets/dsc_et.o ${KLIBS}
--- debathena-discuss-10.0.8.orig/libds/res_module.c
+++ debathena-discuss-10.0.8/libds/res_module.c
@@ -33,18 +33,21 @@
 #include <string.h>
 #include <ctype.h>
 
-#ifdef KERBEROS
-#include "krb.h"
+#ifdef HAVE_KRB4
+#include <krb.h>
 #ifndef MAX_K_NAME_SZ
 /* @#$%^$ last minute changes by jtkohl */
 #define krb_get_lrealm get_krbrlm
 #endif
-static void ExpandHost ();
-#endif /* KERBEROS */
+#endif /* HAVE_KRB4 */
+
+#ifdef HAVE_KRB5
+#include <krb5.h>
+#endif /* HAVE_KRB5 */
 
-#ifdef KERBEROS5
-#include "krb5.h"
-#endif /* KERBEROS5 */
+#if defined(HAVE_KRB5) || defined(HAVE_KRB4)
+static void ExpandHost ();
+#endif /* HAVE_KRB5 || HAVE_KRB4 */
 
 #ifndef SNAME_SZ
 #define SNAME_SZ 30
@@ -228,34 +231,29 @@
 
     /* generate the service name, but concatenating "discuss.instance@realm"
      * desired realm. */
-#ifndef KERBEROS
-    strcpy (service_id, "discuss@");
-    strcpy (&service_id[8], REALM);
+    strcpy (service_id, "discuss");
+#if defined(HAVE_KRB5) || defined(HAVE_KRB4)
+#ifdef HAVE_KRB5
+    strcat (service_id, "/");
 #else
-#ifndef KERBEROS5
-    strcpy (service_id, "discuss.");
-    ExpandHost (myhnamep, &service_id[8], realm);
-    strcat(service_id, "@");
-    if (realmp)
-	strcat (service_id, realmp);
-    else
-	strcat (service_id, realm);
-#else
-    strcpy (service_id, "discuss/");
+    strcat (service_id, ".");
+#endif
     ExpandHost (myhnamep, &service_id[8], realm);
     strcat(service_id, "@");
     if (realmp)
         strcat (service_id, realmp);
     else
         strcat (service_id, realm);
-#endif /* KERBEROS5 */
-#endif /* KERBEROS */
+#else /* HAVE_KRB5 || HAVE_KRB4 */
+    strcat (service_id, "@");
+    strcpy (&service_id[8], REALM);
+#endif /* HAVE_KRB5 || HAVE_KRB4 */
     *hostp = myhnamep;
     *servp = service_id;
     *result = 0;
 }
 
-#ifdef KERBEROS
+#if defined(HAVE_KRB4) || defined(HAVE_KRB5)
 /*
  *
  * ExpandHost -- takes a user string alias for a host, and converts it
@@ -284,16 +282,35 @@
      * could give the command "menel echo foo" and we will resolve
      * it to "menelaus".
      */
+#ifdef HAVE_KRB5
+    krb5_context context;
+    char **hrealms = 0;
+    krb5_error_code retval;
+
+    retval = krb5_init_context(&context);
+    if (!retval)
+      krb5_get_host_realm(context, primary_name, &hrealms);
+    if (!retval && !hrealms[0])
+      strcpy(krb_realm, hrealms[0]);
+    if (retval)
+      strcpy(krb_realm, local_realm());
+
+    if (hrealms)
+      krb5_free_host_realm(context, hrealms);
+    if (context)
+      krb5_free_context(context);
+#else /* HAVE_KRB5 */
     (void) strcpy(krb_realm, (char *)krb_realmofhost(primary_name));
+#endif
     /* lower case Kerberos host name */
     do {
 	if (isupper(*sp)) *dp=tolower(*sp);
 	else *dp = *sp;
-#ifdef KERBEROS5
+#ifdef HAVE_KRB5
     } while (dp++,*sp++);
 #else
     } while (dp++,*sp && (*sp++ != '.'));
-#endif /* KERBEROS5 */
+#endif /* HAVE_KRB5 */
     *(--dp) = 0;
 
     /* heuristics */
@@ -306,18 +323,29 @@
 #endif
     return;
 }
-#endif
+#endif /* HAVE_KRB4 || HAVE_KRB5 */
 
 const char *local_realm ()
 {
-#ifdef KERBEROS
+#ifdef HAVE_KRB4
     static char realm [REALM_SZ] = "";
 
     if (realm [0] == '\0')
 	krb_get_lrealm (realm, 1);
 
     return (realm);
-#else /* KERBEROS */
+#elif defined(HAVE_KRB5)
+    krb5_context context;
+    static char *realm = NULL;
+
+    if (!realm) {
+      krb5_init_context(&context);
+      krb5_get_default_realm(context, &realm);
+      krb5_free_context(context);
+    }
+
+    return realm;
+#else /* HAVE_KRB4 */
     return (REALM);
-#endif /* KERBEROS */
+#endif /* HAVE_KRB4 */
 }
--- debathena-discuss-10.0.8.orig/libds/auth_krb.c
+++ debathena-discuss-10.0.8/libds/auth_krb.c
@@ -22,10 +22,13 @@
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
+#ifdef HAVE_KRB4
 #include "krb.h"
-#ifdef KERBEROS5
+#endif /* HAVE_KRB4 */
+#ifdef HAVE_KRB5
 #include "krb5.h"
-#endif /* KERBEROS5 */
+#endif /* HAVE_KRB5 */
+#include "discuss_err.h"
 
 char *local_host_name ();
 
@@ -45,14 +48,18 @@
 int *authl;
 int *result;
 {
-#ifdef KERBEROS5
+#ifdef HAVE_KRB5
      get_authenticator_krb5(service_id, checksum, authp, authl, result);
-#else
+#elif HAVE_KRB4
      get_authenticator_krb4(service_id, checksum, authp, authl, result);
-#endif /* KERBEROS5 */
+#else /* No Kerberos */
+     *authl = 0;
+     *authp = NULL;
+     *result = DISC_NO_KRB;
+#endif
 }
 
-#ifdef KERBEROS5
+#ifdef HAVE_KRB5
 get_authenticator_krb5 (service_id, checksum, authp, authl, result)
 char *service_id;
 int checksum;
@@ -74,7 +81,7 @@
 	 exit(1);
      }
 
-     initialize_krb_error_table();
+     initialize_krb5_error_table();
 
      realmp = strchr (service_id, '@');
      if (realmp == NULL || realmp - service_id >= sizeof (serv)) {
@@ -116,8 +123,9 @@
          *result = 0;
      }
 }
-#endif /* KERBEROS5 */
+#endif /* HAVE_KRB5 */
 
+#ifdef HAVE_KRB4
 get_authenticator_krb4 (service_id, checksum, authp, authl, result)
 char *service_id;
 int checksum;
@@ -162,4 +170,4 @@
 	 *result = rem + ERROR_TABLE_BASE_krb;
      }
 }
-
+#endif /* HAVE_KRB4 */
--- debathena-discuss-10.0.8.orig/libds/Makefile.in
+++ debathena-discuss-10.0.8/libds/Makefile.in
@@ -56,7 +56,7 @@
 	${RANLIB} libdsk.a
 
 res_module.k.o: res_module.c
-	${CC} ${ALL_CFLAGS} -DKERBEROS5 -DKERBEROS -c res_module.c
+	${CC} ${ALL_CFLAGS} -c res_module.c
 	mv res_module.o res_module.k.o
 
 res_module.nk.o: res_module.c
@@ -64,10 +64,10 @@
 	mv res_module.o res_module.nk.o
 
 auth_krb.o:
-	${CC} ${ALL_CFLAGS} -DKERBEROS5 -DKERBEROS -c auth_krb.c
+	${CC} ${ALL_CFLAGS} -c auth_krb.c
 
 rpcall.k.o:
-	${CC} ${ALL_CFLAGS} -DKERBEROS5 -DKERBEROS -c rpcall.c
+	${CC} ${ALL_CFLAGS} -c rpcall.c
 	mv rpcall.o rpcall.k.o
 
 rpcall.nk.o:
--- debathena-discuss-10.0.8.orig/libds/rpcall.c
+++ debathena-discuss-10.0.8/libds/rpcall.c
@@ -38,9 +38,10 @@
 #include <discuss/tfile.h>
 #include "rpc.h"
 #include "config.h"
-#ifdef KERBEROS5
+#ifdef HAVE_KRB5
 #include "krb5.h"
-#endif /* KERBEROS5 */
+#endif /* HAVE_KRB5 */
+#include "rpc_et.h"
 
 /* DEFINES */
 
@@ -385,7 +386,7 @@
 	    sendshort(*authp++);
 	}
 	USP_end_block(us);
-#ifdef KERBEROS5
+#ifdef HAVE_KRB5
 	/* Prior to server version 3, Kerberos 5 wasn't an available
 	 * authentication method, so we need to send a Kerberos 4 ticket.
 	 * Unfortunately, there's no way to query the server version sooner. */
@@ -396,6 +397,7 @@
         char realm[30];
         krb5_context context;
 	if (get_server_version() < SERVER_3) {
+#ifdef HAVE_KRB4
 	    kcode = krb5_init_context(&context);
 	    if (kcode) {
 	        com_err("discuss", kcode, "while initializing krb5");
@@ -427,8 +429,11 @@
 		}
 		USP_end_block(us);
 	    }
+#else /* HAVE_KRB4 */
+            com_err("discuss", RPC_SERVER_TOO_OLD, "while authenticating to discuss server");
+#endif /* HAVE_KRB4 */
 	}
-#endif /* KERBEROS5 */
+#endif /* HAVE_KRB5 */
     } else {
 	USP_begin_block(us,KRB_TICKET);	/* send blank ticket */
 	sendshort(0);
