.SS Windows-Specific Options:
.\"*********************************************************
.TP
-.B \-\-win-sys path|'env'
+.B \-\-win-sys path
Set the Windows system directory pathname to use when looking for system
executables such as
.B route.exe
and
.B netsh.exe.
By default, if this directive is
-not specified, the pathname will be set to "C:\\WINDOWS"
-
-The special string
-.B 'env'
-indicates that the pathname should be read from the
-.B SystemRoot
-environmental variable.
+not specified, OpenVPN will use the SystemRoot environment variable.
+
+This option have changed behaviour in OpenVPN 2.3. Earlier you had to
+define
+.B --win-sys env
+to use the SystemRoot environment variable, otherwise it defaulted to C:\\WINDOWS.
+It is not needed to use the
+.B env
+keyword any more, and it will just be ignored. A warning is logged when this
+is found in the configuration file.
.\"*********************************************************
.TP
.B \-\-ip-win32 method
/* initialize environmental variable store */
c.es = env_set_create (NULL);
#ifdef WIN32
- env_set_add_win32 (c.es);
+ set_win_sys_path_via_env (c.es);
#endif
#ifdef ENABLE_MANAGEMENT
#ifdef WIN32
"\n"
"Windows Specific:\n"
- "--win-sys path|'env' : Pathname of Windows system directory, C:\\WINDOWS by default.\n"
- " If specified as 'env', read the pathname from SystemRoot env var.\n"
+ "--win-sys path : Pathname of Windows system directory. Default is the pathname\n"
+ " from SystemRoot environment variable.\n"
"--ip-win32 method : When using --ifconfig on Windows, set TAP-Win32 adapter\n"
" IP address using method = manual, netsh, ipapi,\n"
" dynamic, or adaptive (default = adaptive).\n"
{
VERIFY_PERMISSION (OPT_P_GENERAL);
if (streq (p[1], "env"))
- set_win_sys_path_via_env (es);
+ msg (M_INFO, "NOTE: --win-sys env is default from OpenVPN v2.3. "
+ "This entry will now be ignored. "
+ "Please remove this entry from your configuration file.");
else
set_win_sys_path (p[1], es);
}
set_win_sys_path (buf, es);
}
-void
-env_set_add_win32 (struct env_set *es)
-{
- set_win_sys_path (DEFAULT_WIN_SYS_PATH, es);
-}
-
const char *
win_get_tempdir()
/* location of executables */
#define SYS_PATH_ENV_VAR_NAME "SystemRoot" /* environmental variable name that normally contains the system path */
-#define DEFAULT_WIN_SYS_PATH "C:\\WINDOWS" /* --win-sys default value */
#define NETSH_PATH_SUFFIX "\\system32\\netsh.exe"
#define WIN_ROUTE_PATH_SUFFIX "\\system32\\route.exe"
#define WIN_IPCONFIG_PATH_SUFFIX "\\system32\\ipconfig.exe"
/* add constant environmental variables needed by Windows */
struct env_set;
-void env_set_add_win32 (struct env_set *es);
/* get and set the current windows system path */
void set_win_sys_path (const char *newpath, struct env_set *es);