Otherwise, the binary seems to *know* the length of the string that it
expected to be in the library, and when bitching of a mismatch it still
truncates the library version to the length that it *expected* the library
version string to be.
Change the name of it to 'openconnect_version_str' at the same time as we
change the datatype, to avoid crashes when linking against an older/newer
library.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
- if (asprintf(&uagent, "%s %s", base, openconnect_version) < 0)
+ if (asprintf(&uagent, "%s %s", base, openconnect_version_str) < 0)
return NULL;
return uagent;
return NULL;
return uagent;
const char *openconnect_get_version (void)
{
const char *openconnect_get_version (void)
{
- return openconnect_version;
+ return openconnect_version_str;
/* A sanity check that the openconnect executable is running against a
library of the same version */
/* A sanity check that the openconnect executable is running against a
library of the same version */
-#define openconnect_version openconnect_binary_version
+#define openconnect_version_str openconnect_binary_version
-#undef openconnect_version
+#undef openconnect_version_str
int verbose = PRG_INFO;
int background;
int verbose = PRG_INFO;
int background;
static void usage(void)
{
printf(_("Usage: openconnect [options] <server>\n"));
static void usage(void)
{
printf(_("Usage: openconnect [options] <server>\n"));
- printf(_("Open client for Cisco AnyConnect VPN, version %s\n\n"), openconnect_version);
+ printf(_("Open client for Cisco AnyConnect VPN, version %s\n\n"), openconnect_version_str);
printf(" --config=CONFIGFILE %s\n", _("Read options from config file"));
printf(" -b, --background %s\n", _("Continue in background after startup"));
printf(" --pid-file=PIDFILE %s\n", _("Write the daemons pid to this file"));
printf(" --config=CONFIGFILE %s\n", _("Read options from config file"));
printf(" -b, --background %s\n", _("Continue in background after startup"));
printf(" --pid-file=PIDFILE %s\n", _("Write the daemons pid to this file"));
setlocale(LC_ALL, "");
#endif
setlocale(LC_ALL, "");
#endif
- if (strcmp(openconnect_version, openconnect_binary_version)) {
+ if (strcmp(openconnect_version_str, openconnect_binary_version)) {
fprintf(stderr, _("WARNING: This version of openconnect is %s but\n"
" the libopenconnect library is %s\n"),
fprintf(stderr, _("WARNING: This version of openconnect is %s but\n"
" the libopenconnect library is %s\n"),
- openconnect_binary_version, openconnect_version);
+ openconnect_binary_version, openconnect_version_str);
}
openconnect_init_openssl();
}
openconnect_init_openssl();
verbose = PRG_TRACE;
break;
case 'V':
verbose = PRG_TRACE;
break;
case 'V':
- printf(_("OpenConnect version %s\n"), openconnect_version);
+ printf(_("OpenConnect version %s\n"), openconnect_version_str);
exit(0);
case 'x':
vpninfo->xmlconfig = keep_config_arg();
exit(0);
case 'x':
vpninfo->xmlconfig = keep_config_arg();
int add_securid_pin(char *token, char *pin);
/* version.c */
int add_securid_pin(char *token, char *pin);
/* version.c */
-extern char openconnect_version[];
+extern const char *openconnect_version_str;
#endif /* __OPENCONNECT_INTERNAL_H__ */
#endif /* __OPENCONNECT_INTERNAL_H__ */
-echo "char openconnect_version[] = \"$v\";" > $1
+echo "const char *openconnect_version_str = \"$v\";" > $1