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>
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
av->uid = acred->cr_ruid; /* default when no pag is set */
#endif
}
- av->initd = 0;
return 0;
}