OpenAFS Master Repository branch, master, updated. BP-openafs-stable-1_8_x-641-gd231134
Gerrit Code Review
Mon, 13 Jul 2020 16:52:01 -0400
The following commit has been merged in the master branch:
Author: Andrew Deason <firstname.lastname@example.org>
Date: Mon May 18 12:38:31 2020 -0500
auth: Avoid cellconfig.c stdio renaming
Since commit 35777145 (solaris-fopen-sucks-20060916), cellconfig.c has
redirected fopen, fclose, and fgets to local functions on
non-64bit-sparc Solaris, in order to work around that platform's stdio
Commit 7c431f7571 (auth: retire writeconfig.c) moved the contents of
writeconfig.c into cellconfig.c. The previous writeconfig.c contained
some calls to stdio, including calling fprintf() on a pointer returned
by fopen() in that file.
Because fopen() was redirected to our local version, this means that
afsconf_SetExtendedCellInfo() calls fopen() to get an
afsconf_iobuffer*, and passes that pointer to the real system
fprintf() later on (instead of a native FILE*). The compiler does warn
about this, but this only happens on Solaris, where --enable-checking
is not implemented, so the build never fails.
To avoid this, remove the #defines for fopen, fgets, and fclose.
Instead, change all of the old cellconfig.c callers to explicitly call
afsconf_fopen, afsconf_fgets, and afsconf_fclose. On the affected
Solaris platforms, we keep our local definitions, and for other
platforms, we just make those functions call their system stdio
equivalents. For the code that was pulled in from writeconfig.c,
callers will just call the system fopen, fprintf, and fclose.
We still keep our local afsconf_FILE* definition on all platforms, so
the compiler will still do typechecking for our local afsconf_f*
functions on all platforms. So now if we make a mistake, it should be
a mistake on all platforms, so platforms with --enable-checking should
flag the error.
Tested-by: BuildBot <email@example.com>
Reviewed-by: Michael Meffie <firstname.lastname@example.org>
Reviewed-by: Mark Vitale <email@example.com>
Tested-by: Mark Vitale <firstname.lastname@example.org>
Reviewed-by: Benjamin Kaduk <email@example.com>
src/auth/cellconfig.c | 69 ++++++++++++++++++++++++++++++++++---------------
1 files changed, 48 insertions(+), 21 deletions(-)
OpenAFS Master Repository