freelance-rw-20040727 openafs-devel-1_3_66
authorJeffrey Altman <jaltman@mit.edu>
Tue, 27 Jul 2004 22:34:46 +0000 (22:34 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 27 Jul 2004 22:34:46 +0000 (22:34 +0000)
Fix cm_Lookup to properly set the rw flag when adding Freelance mount
points based on whether the filename begins with a '.'

Fix cm_FreelanceAddMount to set the cellname to the cellname without
the '.' when rw mode is used and a cellname is not provided.

src/WINNT/afsd/cm_freelance.c
src/WINNT/afsd/cm_vnodeops.c

index 0c6152e..0438f5c 100644 (file)
@@ -589,9 +589,8 @@ long cm_FreelanceAddMount(char *filename, char *cellname, char *volume, int rw,
               osi_LogSaveString(afsd_logp,cellname), 
               osi_LogSaveString(afsd_logp,volume), rw ? "rw" : "ro");
     if (cellname[0] == '.') {
-        if (!cm_GetCell_Gen(&cellname[1], &fullname[1], CM_FLAG_CREATE))
+        if (!cm_GetCell_Gen(&cellname[1], fullname, CM_FLAG_CREATE))
             return -1;
-        fullname[0]='.';
     } else {
         if (!cm_GetCell_Gen(cellname, fullname, CM_FLAG_CREATE))
             return -1;
index 5fde067..3ffb9fb 100644 (file)
@@ -1012,7 +1012,7 @@ long cm_Lookup(cm_scache_t *dscp, char *namep, long flags, cm_user_t *userp,
         else {  /* nonexistent dir on freelance root, so add it */
                        osi_Log1(afsd_logp,"cm_Lookup adding mount for non-existent directory: %s", 
                      osi_LogSaveString(afsd_logp,namep));
-            code = cm_FreelanceAddMount(namep, namep, "root.cell.", 0, &rock.fid);
+                       code = cm_FreelanceAddMount(namep, namep, "root.cell.", namep[0] == '.', &rock.fid);
             if (code < 0) {   /* add mount point failed, so give up */
                 if (flags & CM_FLAG_CHECKPATH)
                     return CM_ERROR_NOSUCHPATH;