]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-windows-freelance-20080211
authorJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 11 Feb 2008 14:46:36 +0000 (14:46 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 11 Feb 2008 14:46:36 +0000 (14:46 +0000)
LICENSE MIT

Do not return BAD_NETWORK_ERROR in response to attempts to create directories
or files in the Freelance root.afs volume.  Instead return ACCESS_DENIED.

BAD_NETWORK_ERROR was being sent because the Freelance cell has no
vldb servers.  Short circuit the error by testing for freelance
in CreateFile and MakeDir

(cherry picked from commit 61bb3b7f096f3b10075dcb1403879e3ec518276b)

src/WINNT/afsd/cm_vnodeops.c

index f9c309f919445e32ca7af00b39cb9d3713a7e138..3f274b0b0c585d66761b37531f79d22c26b95255 100644 (file)
@@ -2689,6 +2689,16 @@ long cm_Create(cm_scache_t *dscp, char *namep, long flags, cm_attr_t *attrp,
         return CM_ERROR_ATSYS;
     }
 
+#ifdef AFS_FREELANCE_CLIENT
+    /* Freelance root volume does not hold files */
+    if (cm_freelanceEnabled &&
+        dscp->fid.cell==AFS_FAKE_ROOT_CELL_ID &&
+        dscp->fid.volume==AFS_FAKE_ROOT_VOL_ID )
+    {
+        return CM_ERROR_NOACCESS;
+    }
+#endif /* AFS_FREELANCE_CLIENT */
+
     /* before starting the RPC, mark that we're changing the file data, so
      * that someone who does a chmod will know to wait until our call
      * completes.
@@ -2839,6 +2849,16 @@ long cm_MakeDir(cm_scache_t *dscp, char *namep, long flags, cm_attr_t *attrp,
         return CM_ERROR_ATSYS;
     }
 
+#ifdef AFS_FREELANCE_CLIENT
+    /* Freelance root volume does not hold subdirectories */
+    if (cm_freelanceEnabled &&
+        dscp->fid.cell==AFS_FAKE_ROOT_CELL_ID &&
+        dscp->fid.volume==AFS_FAKE_ROOT_VOL_ID )
+    {
+        return CM_ERROR_NOACCESS;
+    }
+#endif /* AFS_FREELANCE_CLIENT */
+
     /* before starting the RPC, mark that we're changing the directory
      * data, so that someone who does a chmod on the dir will wait until
      * our call completes.