From: Rainer Toebbicke Date: Mon, 14 Sep 2009 11:53:56 +0000 (+0100) Subject: Init the vrequest structure correctly X-Git-Tag: debian/1.4.11+dfsg-3~5 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=7535c54e31c5c035ceacb1abf598a519067aa54e;p=packages%2Fo%2Fopenafs.git Init the vrequest structure correctly 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 Reviewed-by: Derrick Brashear --- diff --git a/src/afs/afs_osi_pag.c b/src/afs/afs_osi_pag.c index 9e3a84f28..ff55f4187 100644 --- a/src/afs/afs_osi_pag.c +++ b/src/afs/afs_osi_pag.c @@ -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; }