From ad54e78d3c648bede3f203f23d73dfbfc40e963c Mon Sep 17 00:00:00 2001 From: Rainer Toebbicke Date: Mon, 14 Sep 2009 13:53:56 +0100 Subject: [PATCH] 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 --- src/afs/afs_osi_pag.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/afs/afs_osi_pag.c b/src/afs/afs_osi_pag.c index 795f75aec..817a27064 100644 --- a/src/afs/afs_osi_pag.c +++ b/src/afs/afs_osi_pag.c @@ -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; } -- 2.39.5