Re: PATCH: CygWin port enhancement - 2nd revision

From: Robert Collins <robert.collins@dont-contact.us>
Date: 18 Aug 2001 18:35:06 +1000

On 18 Aug 2001 10:10:24 +0200, Guido Serassio wrote:
> Hi,
>
> >Exactly - Henrik's suggestion was to alter squid to iterate through the
> >list of paths and use the first existing file. A file list of
> >"/etc/hosts <win9x hosts> <winnt hosts>" will work correctly in all
> >cases, with no runtime detection needed.
>
> Sorry, but according to Microsoft specification, hosts file on Windows
> system is NEVER static:

If you see my earlier email I suggested the macro containing paths.
 
> correct path are:
>
> %windir%\hosts on Windows 9x systems
> %systemroot%\system32\drivers\etc\hosts on NT class systems

Sure. Thats the text I'm proposing be in the squid.conf file. There
shouldn't be any problem with that. To restate this
===
etchostpath "/etc/hosts $windir\hosts \
 $systemroot\system32\drivers\etc\hosts"
===

> Windows 9x system disk different from C: are very unusual, but on Windows
> NT this happens more often, for example my machine is a dual boot system,
> and Windows 2000 is on D:.
> On Windows NT Systems, the OS path resolution is totally dynamic, see
> %systemroot%, %systemdrive%, etc.

Absolutely. They are environment variables, so as long as squid allows
environment variables in its path resolution, there is no problem. If
squid doesn't allow that (environment variables in paths) today, I think
that would be a useful enhancement (for conf options at least).

> For example, the correct procedure on NT system to read the hosts file must be:
>
> 1) Read from the registry value
> HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DataBasePath the
> Hosts file location (but this step can be safely skipped, because i never
> seen this value changed from %SystemRoot%\System32\drivers\etc).

Sure. But we both agree that if someone has moved the file, they need to
edit squid.conf. Just as if on unix they have a custom resolver without
/etc/hosts they would need to edit suqid.conf.

> 2) Resolve %SistemRoot%

See above (env variable resolving).

> 3) Read Hosts file.
>
>
> Another thing: using static paths, on dual boot systems can happen everything.

I'm well aware of that :]. It gets particularly bad with multiple
installs in the same partition (c:\winnt and c:\win2k for example). The
program files directory needs to be munged as well. (I'm no stranger to
this sort of muddling around).
Rob
Received on Sat Aug 18 2001 - 02:34:53 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:12 MST