Re: includes inside squid.conf

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Tue, 2 Apr 2002 12:22:31 +0200

On Tuesday 02 April 2002 11:36, Andres Kroonmaa wrote:

> > And I'll even dare to bet that your loop detection based on
> > inodes is incorrect even for UNIX.
>
> why?

Because I know the complexity involved when comparing two inodes, and
with my ego I dare to bet you have not fully understood what an inode
number is and is most likely to produce the code you show below ;-)

> > There won't be a need for inode based complex junk in this simple
> > thing.
>
> complex junk?? if (stat(file_name, &sb) if (sb.st_ino==seen_ino)
> fail()}

a) The above code is not correct. You are missing important parts of
the inode identity in order to compare two inode numbers. Go back and
read on what an inode and inode number is ;-)

b) stat() is not at all portable, not even within the different UNIX
flavors or different variants of the same UNIX flavor.

Not portable outside UNIX as other systems have other notions for how
to identify a "file". The notion of a "inode" is quite unique for
UNIX.

Not portable within UNIX flavors as there are filesystems and systems
using inode identities not compatible with the normal stat() call,
requiring you to use the non-standardized stat64() call if available
to get the full picture..

As it is today the stat() call is almost always crippled due to
limited backwards compability with older 32 bit interfaces, which
more and more systems go beyond in one aspect or another, making it
almost a useless call for the time beeing. Once the 64/32 bits
transition settles down situation will be back to more or less
normal..

Note: Some many years ago the same problems was seen in the 16->32
transition of most stat fields. There is still effects of this seen
in various long-lived utilities using inode numbers and user ID's
such as cpio and tar..

Regards
Henrik
Received on Tue Apr 02 2002 - 03:23:02 MST

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