require-administer-permission-for-mount-point-creation-harder-20010926
authorNickolai Zeldovich <kolya@mit.edu>
Mon, 1 Oct 2001 18:35:50 +0000 (18:35 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 1 Oct 2001 18:35:50 +0000 (18:35 +0000)
make sure a mount point isn't being created if the user isn't allowed to
do that

src/viced/afsfileprocs.c

index db734a3..69b880b 100644 (file)
@@ -2536,15 +2536,15 @@ SAFSS_Symlink (tcon, DirFid, Name, LinkContents, InStatus, OutFid, OutFidStatus,
     }
 
     /*
-     * If we're creating a mount point (owner mode bits sans x bit), we must
-     * have administer access to the directory, too.  Always allow sysadmins
+     * If we're creating a mount point (any x bits clear), we must have
+     * administer access to the directory, too.  Always allow sysadmins
      * to do this.
      */
-    if ((InStatus->Mask & AFS_SETMODE) && !(InStatus->UnixModeBits & 0100)) {
+    if ((InStatus->Mask & AFS_SETMODE) && !(InStatus->UnixModeBits & 0111)) {
        /*
-        * We have a symlink, 'cause we're trying to set the Unix mode bits
-        * to something without the owner x bits (default mode bits if
-        * AFS_SETMODE is false is 0777)
+        * We have a mountpoint, 'cause we're trying to set the Unix mode
+        * bits to something with some x bits missing (default mode bits
+        * if AFS_SETMODE is false is 0777)
         */
        if (VanillaUser(client) && !(rights & PRSFS_ADMINISTER)) {
            errorCode = EACCES;