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.

Patch attached, openafs-bugs bcc'd.

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Rainer Toebbicke
European Laboratory for Particle Physics(CERN) - Geneva, Switzerland
Phone: +41 22 767 8985       Fax: +41 22 767 7155
--- openafs/src/afs/afs_osi_pag.c.~     2009-09-03 12:01:11.000000000 +0200
+++ openafs/src/afs/afs_osi_pag.c       2009-09-03 12:01:12.000000000 +0200
@@ -429,17 +429,10 @@
 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 @@
        av->uid = acred->cr_ruid;       /* default when no pag is set */
 #endif
     }
-    av->initd = 0;
     return 0;
 }
 

Reply via email to