Hi, On Thu, Nov 12, 2015 at 09:41:27PM -0500, Selva Nair wrote: > FWIW, fixes trac #500 > > Signed-off-by: Selva Nair <selva.n...@gmail.com> > --- > src/openvpn/win32.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/src/openvpn/win32.c b/src/openvpn/win32.c > index 7c89a5a..d06b41f 100644 > --- a/src/openvpn/win32.c > +++ b/src/openvpn/win32.c > @@ -763,7 +763,12 @@ win_safe_filename (const char *fn) > static char * > env_block (const struct env_set *es) > { > - char * force_path = > "PATH=C:\\Windows\\System32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem"; > + char force_path[256]; > + char *sysroot = get_win_sys_path(); > + > + if (!openvpn_snprintf(force_path, sizeof(force_path), > "PATH=%s\\System32;%s;%s\\System32\\Wbem", > + sysroot, sysroot, sysroot)) > + msg(M_WARN, "env_block: default path truncated to %s", force_path);
Cool :-) This bug was nagging me since quite a while, but I did not know how to read the "correct" windows path - and didn't know about get_win_sys_path(). OTOH, I'm not sure if this is going to work - win_sys_path is (unless set from options.c) initialized via GetEnvironmentVariable (SYS_PATH_ENV_VAR_NAME, buf, sizeof(buf) set_win_sys_path (buf, es); ... and that is likely to contain more than "c:\windows", but "a number of path elements"... so it's not really "sysroot". What am I missing? gert -- USENET is *not* the non-clickable part of WWW! //www.muc.de/~gert/ Gert Doering - Munich, Germany g...@greenie.muc.de fax: +49-89-35655025 g...@net.informatik.tu-muenchen.de
signature.asc
Description: PGP signature