Check for interactive service only if OpenVPN version is >= 2.4

This makes it less confusing to run GUI v11 with OpenVPN 2.3.x

Signed-off-by: Selva Nair <selva.nair@gmail.com>
pull/90/head
Selva Nair 2016-11-01 22:53:26 -04:00
parent 4d6a879ce3
commit 81ece9690e
3 changed files with 9 additions and 2 deletions

2
main.c
View File

@ -187,7 +187,7 @@ int WINAPI _tWinMain (HINSTANCE hThisInstance,
exit(1); exit(1);
} }
if (!IsUserAdmin()) if (!IsUserAdmin() && strtod(o.ovpn_version, NULL) > 2.3)
CheckIServiceStatus(TRUE); CheckIServiceStatus(TRUE);
BuildFileList(); BuildFileList();

View File

@ -1431,8 +1431,14 @@ CheckVersion()
CloseHandle(pi.hProcess); CloseHandle(pi.hProcess);
/* OpenVPN version 2.x */ /* OpenVPN version 2.x */
if (strstr(line, match_version)) char *p = strstr(line, match_version);
if (p)
{
retval = TRUE; retval = TRUE;
p = strtok(p+8, " ");
strncpy(o.ovpn_version, p, _countof(o.ovpn_version)-1);
o.ovpn_version[_countof(o.ovpn_version)] = '\0';
}
} }
out: out:

View File

@ -172,6 +172,7 @@ typedef struct {
BOOL session_locked; BOOL session_locked;
HANDLE netcmd_semaphore; HANDLE netcmd_semaphore;
version_t version; version_t version;
char ovpn_version[16]; /* OpenVPN version string: 2.3.12, 2.4_alpha2 etc.. */
} options_t; } options_t;
void InitOptions(options_t *); void InitOptions(options_t *);