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>
Tue, 10 Feb 2015 07:33:35 +0000 (02:33 -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.

Reviewed-on: http://gerrit.openafs.org/11693
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 0008ca80a873975e042993b30cbdc47d8f8f116b)

Change-Id: Idb2046e7e1fa4d327e6af794f7803981f56f3763
Reviewed-on: http://gerrit.openafs.org/11735
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 {