]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Init the vrequest structure correctly
authorRainer Toebbicke <rtb@pclella.cern.ch>
Mon, 14 Sep 2009 11:53:56 +0000 (12:53 +0100)
committerRuss Allbery <rra@debian.org>
Tue, 15 Sep 2009 00:48:26 +0000 (17:48 -0700)
Init the vrequest structure correctly

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 9e3a84f2827d2f82c82301df15b30c7f3dfce59b..ff55f4187a106208d3d669be165a9baa79bc93f3 100644 (file)
@@ -429,17 +429,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
@@ -458,7 +451,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;
 }