]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-windows-scp-recycle-init-20070208
authorJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 8 Feb 2007 13:51:40 +0000 (13:51 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 8 Feb 2007 13:51:40 +0000 (13:51 +0000)
when we recycle a stat cache object be sure to clear the file type so
we don't inherit the previous file type if the fetch status fails.

in merge status, clear the file type if the errorCode is EACCESS

(cherry picked from commit 403b5086dddf16ef360b3dade0f3fa0e12db5b71)

src/WINNT/afsd/cm_access.c
src/WINNT/afsd/cm_scache.c

index c5be4871769bb48728d6c7c7b6a529759b0386e5..51051891159e6ae489c36e8fd0e18f98bd2ad333 100644 (file)
@@ -44,8 +44,8 @@ int cm_HaveAccessRights(struct cm_scache *scp, struct cm_user *userp, afs_uint32
     long trights;
 
     if (scp->flags & CM_SCACHEFLAG_EACCESS) {
-       *outRightsp = aclScp->anyAccess;
-       return CM_ERROR_NOACCESS;
+       *outRightsp = 0;
+       return 1;
     }
 
     didLock = 0;
@@ -68,7 +68,7 @@ int cm_HaveAccessRights(struct cm_scache *scp, struct cm_user *userp, afs_uint32
                 return 0;
             }
 
-            /* check that we have a callback, too */
+           /* check that we have a callback, too */
             if (!cm_HaveCallback(aclScp)) {
                 /* can't use it */
                 lock_ReleaseMutex(&aclScp->mx);
@@ -103,7 +103,7 @@ int cm_HaveAccessRights(struct cm_scache *scp, struct cm_user *userp, afs_uint32
         *outRightsp = trights;
     }
 
-    if (scp->fileType != CM_SCACHETYPE_DIRECTORY) {
+    if (scp->fileType > 0 && scp->fileType != CM_SCACHETYPE_DIRECTORY) {
        /* check mode bits */
        if ((scp->unixModeBits & 0400) == 0) {
            osi_Log2(afsd_logp,"cm_HaveAccessRights UnixMode removing READ scp 0x%p unix 0x%x", 
index 71968ca8af8a7c1e6ada55eebb9569167528d985..fe34e3e62850c34aa1a13a6dfc5d85a3e99fdf73 100644 (file)
@@ -149,6 +149,7 @@ long cm_RecycleSCache(cm_scache_t *scp, afs_int32 flags)
 
     /* invalidate so next merge works fine;
      * also initialize some flags */
+    scp->fileType = 0;
     scp->flags &= ~(CM_SCACHEFLAG_STATD
                     | CM_SCACHEFLAG_DELETED
                     | CM_SCACHEFLAG_RO
@@ -579,7 +580,7 @@ long cm_GetSCache(cm_fid_t *fidp, cm_scache_t **outScpp, cm_user_t *userp,
             return 0;
         }
     }
-        
+
     // yj: when we get here, it means we don't have an scp
     // so we need to either load it or fake it, depending
     // on whether the file is "special", see below.
@@ -1318,6 +1319,8 @@ void cm_MergeStatus(cm_scache_t *dscp,
        scp->flags |= CM_SCACHEFLAG_EACCESS;
        osi_Log2(afsd_logp, "Merge, Failure scp %x code 0x%x", scp, statusp->errorCode);
 
+       scp->fileType = 0;      /* unknown */
+
        scp->serverModTime = 0;
        scp->clientModTime = 0;
        scp->length.LowPart = 0;