windows-vnodeops-20080208
authorJeffrey Altman <jaltman@secure-endpoints.com>
Sat, 9 Feb 2008 02:26:28 +0000 (02:26 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Sat, 9 Feb 2008 02:26:28 +0000 (02:26 +0000)
LICENSE MIT

Add support for returning RANGE_NOT_LOCKED errors

Do not attempt to add a mount point for share names of the form
<cell><mount-type><volume>.  Its just a big waste of time.  DNS
queries and CellServDB file searches are expensive.

src/WINNT/afsd/cm_vnodeops.c

index 6ae6b16..8a2ee00 100644 (file)
@@ -1282,7 +1282,8 @@ long cm_LookupInternal(cm_scache_t *dscp, char *namep, long flags, cm_user_t *us
             else
                 return CM_ERROR_NOSUCHFILE;
         }
-        else {  /* nonexistent dir on freelance root, so add it */
+               else if (!strchr(namep, '#') && !strchr(namep, '%')) { 
+            /* nonexistent dir on freelance root, so add it */
             char fullname[200] = ".";
             int  found = 0;
 
@@ -4738,7 +4739,7 @@ long cm_Unlock(cm_scache_t *scp,
         lock_ReleaseRead(&cm_scacheLock);
 
         /* The lock didn't exist anyway. *shrug* */
-        return 0;
+        return CM_ERROR_RANGE_NOT_LOCKED;
     }
 
     lock_ReleaseRead(&cm_scacheLock);