--- 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,18 @@
+Source: debathena-liblocker
+Section: 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-dev
+Section: libdevel
+Architecture: any
+Provides: liblocker-dev, debathena-liblocker
+Conflicts: debathena-liblocker (<= 0.0.20060312)
+Replaces: debathena-liblocker (<= 0.0.20060312)
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Locker management library functions for Athena
+ 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,18 @@
+Source: debathena-liblocker
+Section: 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-dev
+Section: libdevel
+Architecture: any
+Provides: liblocker-dev, debathena-liblocker
+Conflicts: debathena-liblocker (<= 0.0.20060312)
+Replaces: debathena-liblocker (<= 0.0.20060312)
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Locker management library functions for Athena
+ 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,12 @@
+#!/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
+
+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 @@
+liblocker-setgid.patch
--- debathena-liblocker-9.4.28.orig/debian/changelog
+++ debathena-liblocker-9.4.28/debian/changelog
@@ -0,0 +1,11 @@
+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
