From 1aa43164d565ff5fdb5c789d394229a090fe0a09 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Mon, 8 Jul 2013 20:29:24 -0400 Subject: [PATCH] bos: Fix Windows import of afsconf_SawCell IBM created a global variable 'afsconf_SawCell' in the kauth package and manipulated its value from within bos.c as part of the calling of ka_Init(). Patchset d52398940d58ccdba4114a9975762f48cc24ad15 exported afsconf_SawCell from afsauthent.dll since bos.exe is built pthreaded. It was previously mixing pthread and not-pthread libraries to access the variable. Unfortunately, the export was declared as a function pointer instead of DATA. Importing a DATA element from a library also requires that the variable be __declspec(dllimport). The use of afsconf_SawCell needs to be replaced but in the meantime fix the import so that bos.exe can start without crashing. Change-Id: Ic780971b55d64e41e1ba9627cdeadd6c27c451fb Reviewed-on: http://gerrit.openafs.org/10054 Tested-by: BuildBot Reviewed-by: Jeffrey Altman --- src/bozo/bos.c | 3 +++ src/libafsauthent/afsauthent.def | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bozo/bos.c b/src/bozo/bos.c index 7d03826..1d35973 100644 --- a/src/bozo/bos.c +++ b/src/bozo/bos.c @@ -1907,6 +1907,9 @@ main(int argc, char **argv) { afs_int32 code; struct cmd_syndesc *ts; +#ifdef AFS_NT40_ENV + __declspec(dllimport) +#endif extern int afsconf_SawCell; #ifdef AFS_AIX32_ENV diff --git a/src/libafsauthent/afsauthent.def b/src/libafsauthent/afsauthent.def index 72e6cd4..eb1f439 100644 --- a/src/libafsauthent/afsauthent.def +++ b/src/libafsauthent/afsauthent.def @@ -157,6 +157,6 @@ EXPORTS afsconf_ParseNetFiles @156 afsconf_SetExtendedCellInfo @157 afsconf_PickClientSecObj @158 - afsconf_SawCell @159 + afsconf_SawCell @159 DATA ka_PrintBytes @160 ka_KeyIsZero @161 -- 1.9.4