OpenConnect v6.0 strerror_s can't found in msvcrt.dll in WindowsXPSP3
pavel_a at live.com
Wed Jul 30 12:31:20 PDT 2014
But we've only recently fixed strerror_r for WinXP. in v. 0.20.3
Use strerror_r in stead of Microsoft's proprietary strerror_s.
-- Pavel A.
On Wed, 2014-07-30 at 12:38 +0800, jacky.he wrote:
> I compile openconnect v6.0 in Fedora 20 with MingW32, and run it successfully in Windows 7,
> but the same program run error in Window XP SP3.
I filed a bug at https://bugzilla.redhat.com/show_bug.cgi?id=1124731
> error message is:
> The procedure entry point strerror_s could not be located in the dynamic link library msvcrt.dll
> seems msvcrt.dll in Windows XP don't support secure version strerror function, how can I resolv this isuss.
Hm. We don't use strerror_s in OpenConnect. Looking through the Fedora
DLLs that we used, I see that p11-kit seems to be the culprit.
I've rebuilt it with the following hack; please could you try the
version I've placed at http://david.woodhou.se/libp11-kit-0.dll (with
--- p11-kit-0.20.2/common/compat.c~ 2013-10-14 13:45:10.000000000 +0100
+++ p11-kit-0.20.2/common/compat.c 2014-07-30 08:49:26.032006202 +0100
@@ -833,7 +833,8 @@ strerror_r (int errnum,
- return strerror_s (buf, buflen, errnum);
+ /* Use strcpy_s because it always NUL-terminates, unlike strncpy */
+ strcpy_s(buf, buflen, strerror(errnum));
#error no strerror_r implementation
It looks like on Windows, strerror() returns a non-constant string. Thus
my hack isn't thread-safe. Perhaps we could *try* finding strerror_s via
LoadLibrary/GetProcAddress, and fall back to the above hack but with
Ick. I hate Windows :)
More information about the p11-glue