Hi,

On Fri, Nov 13, 2015 at 10:21:12AM -0500, Selva Nair wrote:
> > 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".
> 
> SYS_PATH_ENV_VAR_NAME is "SystemRoot" so that will set win_sys_path to
> %SystemRoot% (aka "C:\\windows" for most people).

AAAH!  I assumed it is just "PATH".  Yes, this should work perfectly
fine then.  (Obviously I did not test this, sorry)

> > What am I missing?
> 
> However, if the user specifies --win-sys some_cruft, win_sys_path will
> get set to that "some_cruft" (in options.c). User is the king.

Yes.  In this case, I do not worry at all - "you get what you ask for".

> Having said that --the man-page description of win-sys is confusing
> and its value is set as win_sys_path without any sanity checks. If
> win_sys_path is not a single base directory name, many other things
> will break; for example in route.c we construct the command line for
> route.exe as
> 
> argv_printf (&argv, "%s%sc ADD %s MASK %s %s",
>          get_win_sys_path(),
>          WIN_ROUTE_PATH_SUFFIX, <---- defined as "\\system32\route.exe"
>                  network,
>                  netmask,
>                  gateway);

Yeah.  "Put garbage in, get interesting problems out".

I should have looked at this example myself - it makes fairly clear that
I was looking at the wrong environment variable.

Thanks again.  ACK, and merging ASAP.

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

Attachment: signature.asc
Description: PGP signature

Reply via email to