mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 15:30:14 +00:00
auth: initKeys before first error exit path
In afsconf_OpenInternal() _afsconf_InitKeys() must be called before the first opportunity to call afsconf_CloseInternal() or a crash can occur if the CellServDB file cannot be parsed. Change-Id: I5b2487056a24d0c4ad78921d85df755758c7679e Reviewed-on: http://gerrit.openafs.org/6059 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com> Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
This commit is contained in:
parent
1c97c04add
commit
833d076e04
@ -659,6 +659,9 @@ afsconf_OpenInternal(struct afsconf_dir *adir, char *cell,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* init the keys queue before any call to afsconf_CloseInternal() */
|
||||||
|
_afsconf_InitKeys(adir);
|
||||||
|
|
||||||
/* The CellServDB file is now open.
|
/* The CellServDB file is now open.
|
||||||
* The following code parses the contents of the
|
* The following code parses the contents of the
|
||||||
* file and creates a list with the first cell entry
|
* file and creates a list with the first cell entry
|
||||||
@ -810,9 +813,8 @@ afsconf_OpenInternal(struct afsconf_dir *adir, char *cell,
|
|||||||
|
|
||||||
if (tf != NULL)
|
if (tf != NULL)
|
||||||
fclose(tf);
|
fclose(tf);
|
||||||
/* now read the fs keys, if possible */
|
|
||||||
|
|
||||||
_afsconf_InitKeys(adir);
|
/* now read the fs keys, if possible */
|
||||||
code = _afsconf_LoadKeys(adir);
|
code = _afsconf_LoadKeys(adir);
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
|
Loading…
Reference in New Issue
Block a user