From 3f09051360caa7c723bc7271bf8eb7075a8b638f Mon Sep 17 00:00:00 2001 From: Emanuel Haupt Date: Thu, 6 Mar 2008 19:11:59 +0000 Subject: Some Cisco Concentrator refuse connection if the presentation version string differs from the official "Cisco VPN Client". Provide an optional patch which masks the original version string. PR: 116949 Submitted by: Raffaele De Lorenzo --- security/vpnc/Makefile | 9 +++++-- security/vpnc/files/patch-config.c | 50 +++++++++++++++++++++++++++++--------- 2 files changed, 46 insertions(+), 13 deletions(-) (limited to 'security/vpnc') diff --git a/security/vpnc/Makefile b/security/vpnc/Makefile index 822102fb901f..7d805b8bc5d5 100644 --- a/security/vpnc/Makefile +++ b/security/vpnc/Makefile @@ -27,8 +27,9 @@ ALL_TARGET= all PORTDOCS= README TODO MAN8= vpnc.8 -OPTIONS+= DECRYPT "cisco-decypt password decrypt utility" on -OPTIONS+= SSL "OpenSSL certificate support (hybrid only)" off +OPTIONS+= DECRYPT "cisco-decypt password decrypt utility" on +OPTIONS+= SSL "OpenSSL certificate support (hybrid only)" off +OPTIONS+= CISCOVERSION "Mask linux presentation string" off MAKE_ENV+= LDFLAGS="${LDFLAGS}" CFLAGS="${CFLAGS}" CC="${CC}" \ BINS="${EXTRABUILDS}" @@ -49,6 +50,10 @@ CFLAGS+= -DOPENSSL_GPL_VIOLATION LDFLAGS+= -lcrypto .endif +.if defined(WITH_CISCOVERSION) +CFLAGS+= -DCISCO_PATCH_VERSION +.endif + post-patch: @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|' ${WRKSRC}/config.c @${REINPLACE_CMD} -e 's|\(/etc/vpnc\)|${PREFIX}\1|' \ diff --git a/security/vpnc/files/patch-config.c b/security/vpnc/files/patch-config.c index ad7e848fd562..890536b9b17c 100644 --- a/security/vpnc/files/patch-config.c +++ b/security/vpnc/files/patch-config.c @@ -1,6 +1,40 @@ ---- config.c.orig 2007-09-10 22:39:48.000000000 +0200 -+++ config.c 2008-02-26 11:33:02.000000000 +0100 -@@ -267,12 +267,12 @@ +--- config.c.orig 2008-03-06 17:03:57.000000000 +0100 ++++ config.c 2008-03-06 17:14:29.000000000 +0100 +@@ -257,17 +257,36 @@ + + static const char *config_def_app_version(void) + { +- struct utsname uts; +- char *version; ++ char *version; ++#ifndef CISCO_PATCH_VERSION ++ struct utsname uts; + +- uname(&uts); +- asprintf(&version, "Cisco Systems VPN Client %s:%s", VERSION, uts.sysname); +- return version; ++ uname(&uts); ++#endif ++ ++#ifdef CISCO_PATCH_VERSION ++ /* ++ * Raffaele De Lorenzo March 2008 ++ * Some Cisco Concentrator refuse connection if the Presentation Version ++ * String is not the same like Official "Cisco VPN Client". This patch ++ * masked the version to "Cisco Systems VPN Client 4.8.00 (0490):Linux", ++ */ ++#define CISCO_CONC_PRESENT_VERSION "Cisco Systems VPN Client 4.8.00 (0490):Linux" ++#endif ++ ++ asprintf(&version, ++#ifdef CISCO_PATCH_VERSION ++ CISCO_CONC_PRESENT_VERSION ++#else ++ "Cisco Systems VPN Client %s:%s", VERSION, uts.sysname ++#endif ++ ); ++ return version; + } static const char *config_def_script(void) { @@ -9,13 +43,7 @@ } static const char *config_def_pid_file(void) - { -- return "/var/run/vpnc/pid"; -+ return "/var/run/vpnc.pid"; - } - - static const char *config_def_vendor(void) -@@ -538,7 +538,7 @@ +@@ -538,7 +557,7 @@ { char *realname; @@ -24,7 +52,7 @@ return realname; } -@@ -757,8 +757,8 @@ +@@ -757,8 +776,8 @@ } if (!got_conffile) { -- cgit v1.2.3