windows-fix-recursion-detection-20070819
authorJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 20 Aug 2007 02:00:48 +0000 (02:00 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 20 Aug 2007 02:00:48 +0000 (02:00 +0000)
the recursion detection code did not take "." and ".." into account.

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

index 9103162..46aac2e 100644 (file)
@@ -1855,8 +1855,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 a558445..53d2409 100644 (file)
@@ -1453,7 +1453,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)