[23180] in Source-Commits

home help back first fref pref prev next nref lref last post

/svn/athena r22841 - in trunk/athena/lib/locker: . debian man

daemon@ATHENA.MIT.EDU (tabbott@MIT.EDU)
Sun Apr 6 17:16:19 2008

Date: Sun, 6 Apr 2008 17:15:48 -0400 (EDT)
From: tabbott@MIT.EDU
Message-Id: <200804062115.RAA29531@drugstore.mit.edu>
To: source-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: tabbott
Date: 2008-04-06 17:15:47 -0400 (Sun, 06 Apr 2008)
New Revision: 22841

Removed:
   trunk/athena/lib/locker/debian/patches/
Modified:
   trunk/athena/lib/locker/afs.c
   trunk/athena/lib/locker/attachtab.c
   trunk/athena/lib/locker/debian/changelog
   trunk/athena/lib/locker/locker_private.h
   trunk/athena/lib/locker/man/attach.conf.5
   trunk/athena/lib/locker/man/attachtab.5
   trunk/athena/lib/locker/mountpoint.c
Log:


Modified: trunk/athena/lib/locker/afs.c
===================================================================
--- trunk/athena/lib/locker/afs.c	2008-04-06 20:57:41 UTC (rev 22840)
+++ trunk/athena/lib/locker/afs.c	2008-04-06 21:15:47 UTC (rev 22841)
@@ -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)
+  else
     {
-      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)
-    {
-      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;
 }
 

Modified: trunk/athena/lib/locker/attachtab.c
===================================================================
--- trunk/athena/lib/locker/attachtab.c	2008-04-06 20:57:41 UTC (rev 22840)
+++ trunk/athena/lib/locker/attachtab.c	2008-04-06 21:15:47 UTC (rev 22841)
@@ -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",

Modified: trunk/athena/lib/locker/debian/changelog
===================================================================
--- trunk/athena/lib/locker/debian/changelog	2008-04-06 20:57:41 UTC (rev 22840)
+++ trunk/athena/lib/locker/debian/changelog	2008-04-06 21:15:47 UTC (rev 22841)
@@ -1,3 +1,9 @@
+debathena-liblocker (10.0.0-1) unstable; urgency=low
+
+  * Merged quilt patches into mainline Athena tree
+
+ -- Shreevatsa R <vatsa@mit.edu>  Sun,  6 Apr 2008 16:12:27 -0400
+
 debathena-liblocker (9.4.28-0debathena12) unstable; urgency=low
 
   * Set ownercheck on and explicit-mntpt off in attach.conf.

Modified: trunk/athena/lib/locker/locker_private.h
===================================================================
--- trunk/athena/lib/locker/locker_private.h	2008-04-06 20:57:41 UTC (rev 22840)
+++ trunk/athena/lib/locker/locker_private.h	2008-04-06 21:15:47 UTC (rev 22841)
@@ -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"
 

Modified: trunk/athena/lib/locker/man/attach.conf.5
===================================================================
--- trunk/athena/lib/locker/man/attach.conf.5	2008-04-06 20:57:41 UTC (rev 22840)
+++ trunk/athena/lib/locker/man/attach.conf.5	2008-04-06 21:15:47 UTC (rev 22841)
@@ -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.

Modified: trunk/athena/lib/locker/man/attachtab.5
===================================================================
--- trunk/athena/lib/locker/man/attachtab.5	2008-04-06 20:57:41 UTC (rev 22840)
+++ trunk/athena/lib/locker/man/attachtab.5	2008-04-06 21:15:47 UTC (rev 22841)
@@ -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

Modified: trunk/athena/lib/locker/mountpoint.c
===================================================================
--- trunk/athena/lib/locker/mountpoint.c	2008-04-06 20:57:41 UTC (rev 22840)
+++ trunk/athena/lib/locker/mountpoint.c	2008-04-06 21:15:47 UTC (rev 22841)
@@ -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;


home help back first fref pref prev next nref lref last post