--- debathena-liblocker-9.4.28.orig/debian/compat
+++ debathena-liblocker-9.4.28/debian/compat
@@ -0,0 +1 @@
+4
--- debathena-liblocker-9.4.28.orig/debian/control.in
+++ debathena-liblocker-9.4.28/debian/control.in
@@ -0,0 +1,27 @@
+Source: debathena-liblocker
+Section: debathena/libs
+Priority: extra
+Maintainer: Debian-Athena Project <debathena@mit.edu>
+Build-Depends: @cdbs@, libopenafs-dev, libkrb5-dev, libhesiod-dev, libzephyr-dev, libzephyr3-krb
+Standards-Version: 3.7.2
+
+Package: debathena-liblocker
+Architecture: all
+Provides: liblocker
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Runtime files for Athena locker management library
+ Locker management library functions for Athena.
+ .
+ This package contains configuration and runtime files.
+
+Package: debathena-liblocker-dev
+Section: debathena/libdevel
+Architecture: any
+Provides: liblocker-dev
+Conflicts: debathena-attach (<< 9.4)
+Replaces: debathena-liblocker (<= 0.0.20060312)
+Depends: ${shlibs:Depends}, ${misc:Depends}, libopenafs-dev, libkrb5-dev, libhesiod-dev, libzephyr-dev, libzephyr3-krb
+Description: Development files for Athena locker management library
+ Locker management library functions for Athena.
+ .
+ This package contains headers and static libraries for development.
--- debathena-liblocker-9.4.28.orig/debian/copyright
+++ debathena-liblocker-9.4.28/debian/copyright
@@ -0,0 +1,20 @@
+The Athena source code was obtained from the Athena CVS repository at
+/afs/dev.mit.edu/source, 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.
+
+This Debian package was created as part of the Debian-Athena Project
+<http://web.mit.edu/debathena/www/> of the MIT Student Information
+Processing Board, and is released to the public domain.
--- debathena-liblocker-9.4.28.orig/debian/control
+++ debathena-liblocker-9.4.28/debian/control
@@ -0,0 +1,27 @@
+Source: debathena-liblocker
+Section: debathena/libs
+Priority: extra
+Maintainer: Debian-Athena Project <debathena@mit.edu>
+Build-Depends: cdbs (>= 0.4.23-1.1), autotools-dev, debhelper (>= 4.2.0), autoconf, quilt, patchutils (>= 0.2.25), cdbs (>= 0.4.27-1), libopenafs-dev, libkrb5-dev, libhesiod-dev, libzephyr-dev, libzephyr3-krb
+Standards-Version: 3.7.2
+
+Package: debathena-liblocker
+Architecture: all
+Provides: liblocker
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Runtime files for Athena locker management library
+ Locker management library functions for Athena.
+ .
+ This package contains configuration and runtime files.
+
+Package: debathena-liblocker-dev
+Section: debathena/libdevel
+Architecture: any
+Provides: liblocker-dev
+Conflicts: debathena-attach (<< 9.4)
+Replaces: debathena-liblocker (<= 0.0.20060312)
+Depends: ${shlibs:Depends}, ${misc:Depends}, libopenafs-dev, libkrb5-dev, libhesiod-dev, libzephyr-dev, libzephyr3-krb
+Description: Development files for Athena locker management library
+ Locker management library functions for Athena.
+ .
+ This package contains headers and static libraries for development.
--- debathena-liblocker-9.4.28.orig/debian/rules
+++ debathena-liblocker-9.4.28/debian/rules
@@ -0,0 +1,20 @@
+#!/usr/bin/make -f
+  
+DEB_AUTO_UPDATE_DEBIAN_CONTROL = 1
+DEB_AUTO_UPDATE_AUTOCONF = 1
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/autotools.mk
+include /usr/share/cdbs/1/rules/patchsys-quilt.mk
+
+DEB_CONFIGURE_EXTRA_FLAGS += --with-afs=/usr --with-krb4=$(shell krb5-config --prefix krb4) --with-krb5 --with-hesiod
+DEB_DH_INSTALL_SOURCEDIR = $(DEB_DESTDIR)
+
+ifeq ($(DEB_BUILD_ARCH),amd64)
+    CFLAGS += -fPIC
+endif
+
+common-install-indep::
+	dh_install -pdebathena-liblocker debian/attach.conf etc/athena/
+
+clean::
+	rm -f configure
--- debathena-liblocker-9.4.28.orig/debian/patches/liblocker-setgid.patch
+++ debathena-liblocker-9.4.28/debian/patches/liblocker-setgid.patch
@@ -0,0 +1,107 @@
+--- debathena-liblocker-orig/afs.c	2007-04-19 23:35:16.000000000 -0400
++++ debathena-liblocker-edit/afs.c	2007-04-19 23:27:55.000000000 -0400
+@@ -267,26 +267,20 @@
+ 
+   /* Make sure nothing is already mounted on our mountpoint. */
+   status = stat(at->mountpoint, &st2);
+-  if (!status && st1.st_dev == st2.st_dev && st1.st_ino == st2.st_ino)
++  if (!status)
+     {
+-      locker__error(context, "%s: Locker is already attached.\n",
+-		    at->name);
+-      return LOCKER_EALREADY;
++      /* Assume the automounter took care of it */
+     }
+-  else if (!status || errno != ENOENT)
+-    {
+-      locker__error(context, "%s: Could not attach locker:\n"
+-		    "Mountpoint %s is busy.\n", at->name, at->mountpoint);
+-      return LOCKER_EMOUNTPOINTBUSY;
+-    }
+-
+-  status = symlink(at->hostdir, at->mountpoint);
+-  if (status < 0)
++  else
+     {
+-      locker__error(context, "%s: Could not attach locker:\n%s while "
++    status = symlink(at->hostdir, at->mountpoint);
++    if (status < 0)
++      {
++        locker__error(context, "%s: Could not attach locker:\n%s while "
+ 		    "symlinking %s to %s\n", at->name, strerror(errno),
+ 		    at->hostdir, at->mountpoint);
+-      return LOCKER_EATTACH;
++        return LOCKER_EATTACH;
++      }
+     }
+ 
+   /* Find host that the locker is on, and update the attachent. */
+@@ -311,7 +305,8 @@
+ {
+   int status;
+ 
+-  status = unlink(at->mountpoint);
++  /* Let the automounter manage the symlink */
++  /* status = unlink(at->mountpoint);
+   if (status < 0)
+     {
+       if (errno == ENOENT)
+@@ -327,6 +322,7 @@
+ 	  return LOCKER_EDETACH;
+ 	}
+     }
++  */
+   return LOCKER_SUCCESS;
+ }
+ 
+--- debathena-liblocker-orig/attachtab.c	2007-04-19 23:35:16.000000000 -0400
++++ debathena-liblocker-edit/attachtab.c	2007-04-19 23:31:28.000000000 -0400
+@@ -514,7 +514,7 @@
+     return LOCKER_ENOMEM;
+ 
+   omask = umask(0);
+-  fd = open(path, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
++  fd = open(path, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
+   umask(omask);
+   if (fd == -1)
+     {
+@@ -909,6 +909,7 @@
+   int status;
+   char *path;
+   struct flock fl;
++  mode_t o_umask;
+ 
+   /* If the attachtab is already locked (because we're reading a
+    * subcomponent of a MUL locker, for instance), just record an
+@@ -927,8 +928,10 @@
+       return LOCKER_ENOMEM;
+     }
+ 
+-  *lock = open(path, O_CREAT | O_TRUNC | O_RDWR, S_IRUSR | S_IWUSR);
++  o_umask = umask(0);
++  *lock = open(path, O_CREAT | O_TRUNC | O_RDWR, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
+   free (path);
++  umask(o_umask);
+   if (*lock < 0)
+     {
+       locker__error(context, "Could not open attachtab lock file: %s.\n",
+--- debathena-liblocker-orig/mountpoint.c	2007-04-19 23:35:16.000000000 -0400
++++ debathena-liblocker-edit/mountpoint.c	2007-04-19 23:34:12.000000000 -0400
+@@ -444,13 +444,16 @@
+   int status;
+   char *lock;
+   struct flock fl;
++  mode_t o_umask;
+ 
+   lock = locker__attachtab_pathname(context, LOCKER_LOCK, ".dirlock");
+   if (!lock)
+     return LOCKER_ENOMEM;
+ 
+-  at->dirlockfd = open(lock, O_CREAT | O_RDWR, S_IWUSR | S_IRUSR);
++  o_umask = umask(0);
++  at->dirlockfd = open(lock, O_CREAT | O_RDWR, S_IWUSR | S_IRUSR | S_IWGRP | S_IRGRP);
+   free(lock);
++  umask(o_umask);
+   if (at->dirlockfd < 0)
+     {
+       at->dirlockfd = 0;
--- debathena-liblocker-9.4.28.orig/debian/patches/series
+++ debathena-liblocker-9.4.28/debian/patches/series
@@ -0,0 +1,2 @@
+liblocker-no-athena-paths.patch
+liblocker-setgid.patch
--- debathena-liblocker-9.4.28.orig/debian/patches/liblocker-no-athena-paths.patch
+++ debathena-liblocker-9.4.28/debian/patches/liblocker-no-athena-paths.patch
@@ -0,0 +1,79 @@
+Index: debathena-liblocker-9.4.28/locker_private.h
+===================================================================
+--- debathena-liblocker-9.4.28.orig/locker_private.h	2007-04-28 22:28:30.000000000 -0400
++++ debathena-liblocker-9.4.28/locker_private.h	2007-04-28 22:29:04.000000000 -0400
+@@ -19,7 +19,7 @@
+ #include <regex.h>
+ #include <stdarg.h>
+ 
+-#define LOCKER_PATH_ATTACHTAB "/var/athena/attachtab"
++#define LOCKER_PATH_ATTACHTAB "/var/run/attachtab"
+ #define LOCKER_PATH_ATTACH_CONF "/etc/athena/attach.conf"
+ #define LOCKER_PATH_LOCAL "/var/athena/local-validated"
+ 
+Index: debathena-liblocker-9.4.28/man/attach.conf.5
+===================================================================
+--- debathena-liblocker-9.4.28.orig/man/attach.conf.5	2007-04-28 22:28:21.000000000 -0400
++++ debathena-liblocker-9.4.28/man/attach.conf.5	2007-04-28 22:29:03.000000000 -0400
+@@ -104,7 +104,7 @@
+ explicit NFS attaches.  See the description for
+ .I nfs-root-hack
+ above.
+-.IP "attachtab (type string) (default: /var/athena/attachtab)"
++.IP "attachtab (type string) (default: /var/run/attachtab)"
+ This option specifies the location of the
+ .I attachtab(5)
+ directory.  It is generally located in /var/athena.
+Index: debathena-liblocker-9.4.28/man/attachtab.5
+===================================================================
+--- debathena-liblocker-9.4.28.orig/man/attachtab.5	2007-04-28 22:28:27.000000000 -0400
++++ debathena-liblocker-9.4.28/man/attachtab.5	2007-04-28 22:29:03.000000000 -0400
+@@ -18,26 +18,26 @@
+ .SH NAME
+ attachtab \- Files used by liblocker
+ .SH SYNOPSIS
+-.B /var/athena/attachtab/
++.B /var/run/attachtab/
+ .SH DESCRIPTION
+ The attachtab directory contains two files and three directories used
+ by liblocker to keep track of attached filesystems.
+ .PP
+ .TP 8
+-.B /var/athena/attachtab/.lock
++.B /var/run/attachtab/.lock
+ This is used as a lock file to synchronize access to the
+ .B locker
+ and
+ .B mountpoint
+ directories, which record attached lockers.
+ .TP 8
+-.B /var/athena/attachtab/.dirlock
++.B /var/run/attachtab/.dirlock
+ This is used to synchronize access to the
+ .B directory
+ subdirectory, which records directories that have been created by
+ liblocker.
+ .TP 8
+-.B /var/athena/attachtab/mountpoint
++.B /var/run/attachtab/mountpoint
+ This directory contains a file for each locker that has been attached.
+ The files each consist of 9 lines containing the following data:
+ .PP
+@@ -55,7 +55,7 @@
+ .fi
+ .RE
+ .TP 8
+-.B /var/athena/attachtab/locker
++.B /var/run/attachtab/locker
+ This directory contains symlinks to the
+ .B mountpoint
+ directory; for each named locker which is attached on its normal
+@@ -65,7 +65,7 @@
+ .B mountpoint
+ directory.
+ .TP 8
+-.B /var/athena/attachtab/directory
++.B /var/run/attachtab/directory
+ This directory contains an empty file for each directory which
+ liblocker has created. This information is used to ensure that created
+ directories are later removed when all of the filesystems mounted in
--- debathena-liblocker-9.4.28.orig/debian/changelog
+++ debathena-liblocker-9.4.28/debian/changelog
@@ -0,0 +1,43 @@
+debathena-liblocker (9.4.28-0debathena7) unstable; urgency=low
+
+  * Build with -fPIC on amd64.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Fri, 13 Jul 2007 18:36:37 -0400
+
+debathena-liblocker (9.4.28-0debathena6) unstable; urgency=low
+
+  * Add missing dependencies to liblocker-dev.
+  * Section: debathena/libs.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Fri, 13 Jul 2007 18:17:04 -0400
+
+debathena-liblocker (9.4.28-0debathena5) unstable; urgency=low
+
+  * Add /etc/athena/attach.conf.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Tue, 26 Jun 2007 17:54:57 -0400
+
+debathena-liblocker (9.4.28-0debathena4) unstable; urgency=low
+
+  * Oops.  Fix empty packages.
+  * Depend adduser.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Sat, 28 Apr 2007 22:52:25 -0400
+
+debathena-liblocker (9.4.28-0debathena3) unstable; urgency=low
+
+  * Configure the attachtab directory.
+
+ -- Tim Abbott <tabbott@mit.edu>  Sat, 28 Apr 2007 22:20:40 -0400
+
+debathena-liblocker (9.4.28-0debathena2) unstable; urgency=low
+
+  * Apply nelhage's setgid patch.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Tue, 24 Apr 2007 19:38:22 -0400
+
+debathena-liblocker (9.4.28-0debathena1) unstable; urgency=low
+
+  * Initial release.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Mon, 29 Jan 2007 23:58:50 -0500
--- debathena-liblocker-9.4.28.orig/debian/attach.conf
+++ debathena-liblocker-9.4.28/debian/attach.conf
@@ -0,0 +1,17 @@
+#
+# Attach configuration file
+#
+# $Id: attach.conf,v 1.6 2001/01/01 16:17:25 ghudson Exp $
+#
+# The order of the nomountpoint and mountpoint lines below is important.
+nomountpoint		^/afs ^/bin ^/boot ^/core ^/dev
+nomountpoint		^/etc ^/home ^/install ^/lib ^/lost+found
+nomountpoint		^/os ^/proc ^/root ^/sbin
+nomountpoint		^/srvd ^/tmp ^/u[0-9]* ^/usr ^/var
+nomountpoint		^/mit/[^/]*/. ^/\.
+mountpoint		/mit/[^/]*
+nomountpoint		/mit
+nosetuid		.
+defoptions {nfs}:.*	rsize=1024,wsize=1024,intr
+options {nfs}:.*	nodev
+allowoptions {nfs}:.*	ro,rw,rsize,wsize,timeo,retrans,soft,hard,actimeo,noac
--- debathena-liblocker-9.4.28.orig/debian/debathena-liblocker.postinst
+++ debathena-liblocker-9.4.28/debian/debathena-liblocker.postinst
@@ -0,0 +1,46 @@
+#!/bin/sh
+# postinst script for debathena-liblocker
+#
+# 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)
+	# Setup attachtab directory.
+	if ! dpkg-statoverride --list /var/run/attachtab >/dev/null; then
+	    chown -R root:attach /var/run/attachtab
+	    chmod -R a=rx,ug+w /var/run/attachtab
+	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-liblocker-9.4.28.orig/debian/debathena-liblocker.preinst
+++ debathena-liblocker-9.4.28/debian/debathena-liblocker.preinst
@@ -0,0 +1,42 @@
+#!/bin/sh
+# preinst script for debathena-liblocker
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <new-preinst> `install'
+#        * <new-preinst> `install' <old-version>
+#        * <new-preinst> `upgrade' <old-version>
+#        * <old-preinst> `abort-upgrade' <new-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    install|upgrade)
+	if ! getent group attach >/dev/null; then
+	    addgroup --system attach
+	fi
+	;;
+
+    abort-upgrade)
+	;;
+
+    *)
+        echo "preinst 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-liblocker-9.4.28.orig/debian/debathena-liblocker.dirs
+++ debathena-liblocker-9.4.28/debian/debathena-liblocker.dirs
@@ -0,0 +1,4 @@
+etc/athena
+var/run/attachtab/directory
+var/run/attachtab/mountpoint
+var/run/attachtab/locker
--- debathena-liblocker-9.4.28.orig/debian/debathena-liblocker-dev.install
+++ debathena-liblocker-9.4.28/debian/debathena-liblocker-dev.install
@@ -0,0 +1,3 @@
+usr/lib/*.a
+usr/share/man/man*/*
+usr/include/*
--- debathena-liblocker-9.4.28.orig/debian/debathena-liblocker.postrm
+++ debathena-liblocker-9.4.28/debian/debathena-liblocker.postrm
@@ -0,0 +1,45 @@
+#!/bin/sh
+# postrm script for debathena-liblocker
+#
+# 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 group attach >/dev/null; then
+	    delgroup --system attach || :
+	fi
+	;;
+
+    remove|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
+
+
