]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Init the vrequest structure correctly
authorRainer Toebbicke <rtb@pclella.cern.ch>
Mon, 14 Sep 2009 12:53:56 +0000 (13:53 +0100)
committerDerrick Brashear <shadow|account-1000005@unknown>
Mon, 14 Sep 2009 13:10:08 +0000 (06:10 -0700)
FIXES 125355
(1.4.x only)

afs_InitReq fails to initialize the "flags" field of the vrequest structure.

Consequently the logic involving (flags & O_NONBLOCK) in afs_Analyze leads to
unpredictable results. afs_InitReq should initialize the complete vrequest
structure.

Reviewed-on: http://gerrit.openafs.org/457
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/afs/afs_osi_pag.c

index 795f75aec4175ba3e7e50733dddf9420ac8b0caa..817a270642c19e93a3b59acb788ff2d4f863b454 100644 (file)
@@ -427,17 +427,10 @@ AddPag(afs_int32 aval, struct AFS_UCRED **credpp)
 int
 afs_InitReq(register struct vrequest *av, struct AFS_UCRED *acred)
 {
-    int i = 0;
-
     AFS_STATCNT(afs_InitReq);
     if (afs_shuttingdown)
        return EIO;
-    av->idleError = 0;
-    av->tokenError = 0;
-    while (i < MAXHOSTS) {
-       av->skipserver[i] = 0;
-       i++;
-    }
+    memset(av, 0, sizeof(*av));
     av->uid = PagInCred(acred);
     if (av->uid == NOPAG) {
        /* Afs doesn't use the unix uid for anuthing except a handle
@@ -456,7 +449,6 @@ afs_InitReq(register struct vrequest *av, struct AFS_UCRED *acred)
        av->uid = acred->cr_ruid;       /* default when no pag is set */
 #endif
     }
-    av->initd = 0;
     return 0;
 }