On Sat, May 19, 2007 at 04:44:16PM +0200, Peter Thomassen wrote:
> When Exim stat()s the file, it seems to follow the link (i.e. lstat())
> which fails. If I change permissions in a way that Exim can read the link
> target, it works fine.
>
> The behaviour described is not that documented in the specification[1]. I'm
> using 4.63, but the specification for 4.67 says the same:
> | dsearch: The given file must be a directory; this is searched for a file
> | whose name is the key. The key may not contain any forward slash
> | characters. The result of a successful lookup is the name of the file.
>
> There is nothing said about any permissions Exim must have for the file
> itself; actually, it seems sufficient that Exim can read the directory.
It should probably say "directory entry" instead of "file". Likewise it
should probably be explicit about how the check is done: stat, lstat, or
something else.
> The code (/src/lookups/dsearch.c) says that stat() is used because the OS
> scans the directory faster than Exim could. And strangely, I can only find
> a stat() call (and not an lstat() call), but the behaviour is like lstat().
> Why?
Because you've got 'stat' and 'lstat' back to front in your head.
--
Dave Evans
Power Internet Limited, registered in England #03053650 at Norfolk House,
82 Saxon Gate West, Central Milton Keynes, Buckinghamshire, MK9 2DL.
For more information, see
http://www.powernet.co.uk/~davide/about-powernet