From b0f16e6a564f305bb7751e946d85a4e70fa50625 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Tue, 20 Jul 2010 12:06:57 -0500 Subject: [PATCH] bozo: Clean up bnode parms for each bnode bosserver was remembering the parms for past bnodes, and just overwriting parms for new bnodes. This is a problem if we have a 'dafs' bnode followed by an 'fs' bnode, since the 'fs' bnode will get the 'dasalvager' parm, and bosserver will think it is its scanner program. So instead keep track of a separate array of the parms that we actually pass to bnode_Create, so we only pass parms that we saw for this specific bnode. Change-Id: Ic609e2156cfd8ecf5b83b3815c5dff235010aa00 Reviewed-on: http://gerrit.openafs.org/2452 Tested-by: Andrew Deason Reviewed-by: Derrick Brashear --- src/bozo/bosserver.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/bozo/bosserver.c b/src/bozo/bosserver.c index 6a62302ba..0d1d47961 100644 --- a/src/bozo/bosserver.c +++ b/src/bozo/bosserver.c @@ -287,6 +287,7 @@ ReadBozoFile(char *aname) afs_int32 i, goal; struct bnode *tb; char *parms[MAXPARMS]; + char *thisparms[MAXPARMS]; int rmode; /* rename BozoInit to BosServer for the user */ @@ -402,6 +403,8 @@ ReadBozoFile(char *aname) } else if (code == 3) notifier = NULL; + memset(thisparms, 0, sizeof(thisparms)); + for (i = 0; i < MAXPARMS; i++) { /* now read the parms, until we see an "end" line */ tp = fgets(tbuffer, sizeof(tbuffer), tfile); @@ -419,12 +422,13 @@ ReadBozoFile(char *aname) if (!parms[i]) /* make sure there's space */ parms[i] = (char *)malloc(BOZO_BSSIZE); strcpy(parms[i], tbuffer + 5); /* remember the parameter for later */ + thisparms[i] = parms[i]; } /* ok, we have the type and parms, now create the object */ code = - bnode_Create(typep, instp, &tb, parms[0], parms[1], parms[2], - parms[3], parms[4], notifier, + bnode_Create(typep, instp, &tb, thisparms[0], thisparms[1], + thisparms[2], thisparms[3], thisparms[4], notifier, goal ? BSTAT_NORMAL : BSTAT_SHUTDOWN, 0); if (code) goto fail; -- 2.39.5