]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-windows-fix-recursion-detection-20070819
authorJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 20 Aug 2007 02:02:03 +0000 (02:02 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 20 Aug 2007 02:02:03 +0000 (02:02 +0000)
the recursion detection code did not take "." and ".." into account.

(cherry picked from commit 4a9d15a2e4d3e91261dfa1c9fe08f75d88fd166d)

src/WINNT/afsd/cm_vnodeops.c
src/WINNT/afsd/cm_volume.c

index 3de994f51449ca84e9f2ff6815beb2849fab4f50..6db7a17ce41deeae0840dae3cad601e9fad623a4 100644 (file)
@@ -1857,8 +1857,10 @@ long cm_NameI(cm_scache_t *rootSCachep, char *pathp, long flags,
                                  userp, reqp, &nscp);
 
                 if (code == 0) {
+                    if (!strcmp(component,".."))
+                        fid_count -=2;
                     for ( i=0; i<fid_count; i++) {
-                        if ( !cm_FidCmp(&nscp->fid, &fids[i]) ) {
+                        if ( strcmp(component,".") && !cm_FidCmp(&nscp->fid, &fids[i]) ) {
                             code = CM_ERROR_TOO_MANY_SYMLINKS;
                             cm_ReleaseSCache(nscp);
                             nscp = NULL;
index 4982283620f5ba9549e59321f1f49bde310190e9..2f45b2618473d09f8f7b479100ffd5cc735c69c3 100644 (file)
@@ -1457,7 +1457,7 @@ static char * volstatus_str(enum volstatus vs)
 
 void cm_VolumeStatusNotification(cm_volume_t * volp, afs_uint32 volID, enum volstatus old, enum volstatus new)
 {
-    char volstr[CELL_MAXNAMELEN + VL_MAXNAMELEN];
+    char volstr[CELL_MAXNAMELEN + VL_MAXNAMELEN]="";
     char *ext = "";
 
     if (volID == volp->rw.ID)