Windows: foo.backup -> foo.backup too many symlinks
authorJeffrey Altman <jaltman@your-file-system.com>
Fri, 23 Jan 2015 00:48:32 +0000 (19:48 -0500)
committerJeffrey Altman <jaltman@your-file-system.com>
Mon, 9 Feb 2015 23:02:31 +0000 (18:02 -0500)
In the case where an explicit mount point to a .backup volume is
resolved from a .backup volume the cache manager refuses to evaluate
the mount point target.  This is meant to address unwanted recursion
in the directory tree searches.

Change the error code to ERROR_TOO_MANY_SYMLINKS and propagate that
error to the AFS redirector.  That will result in the application
receiving STATUS_ACCESS_DENIED instead of
STATUS_REPARSE_POINT_NOT_RESOLVED.

The STATUS_REPARSE_POINT_NOT_RESOLVED error causes cmd.exe and
powershell.exe to terminate recursive directory searches.

Change-Id: I5dfdd835e8696b823af45a8e5c33a5ca6320cf31
Reviewed-on: http://gerrit.openafs.org/11693
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsd/cm_vnodeops.c
src/WINNT/afsrdr/user/RDRFunction.c

index 4814188..b73f90b 100644 (file)
@@ -980,7 +980,7 @@ long cm_FollowMountPoint(cm_scache_t *scp, cm_scache_t *dscp, cm_user_t *userp,
     if (targetType == BACKVOL
          && (scp->flags & (CM_SCACHEFLAG_RO | CM_SCACHEFLAG_PURERO))
          == CM_SCACHEFLAG_RO) {
-        code = CM_ERROR_NOSUCHVOLUME;
+       code = CM_ERROR_TOO_MANY_SYMLINKS;
         goto done;
     }
 
index f1c6b59..c281817 100644 (file)
@@ -625,6 +625,8 @@ RDR_PopulateCurrentEntry( IN  AFSDirEnumEntry * pCurrentEntry,
                    } else {
                        osi_Log2(afsd_logp, "RDR_PopulateCurrentEntry cm_FollowMountPoint failed scp=0x%p code=0x%x",
                                  scp, code2);
+                       if (code2 == CM_ERROR_TOO_MANY_SYMLINKS)
+                           code = CM_ERROR_TOO_MANY_SYMLINKS;
                    }
                 }
             } else {