<<< Date Index >>>     <<< Thread Index >>>

Re: Header cache and slashes



On 17Mar2006 18:24, Derek Martin <invalid@xxxxxxxxxxxxxx> wrote:
| On Fri, Mar 17, 2006 at 11:36:00PM +0100, Phil Pennock wrote:
| > In Unix, the difference between "cd /etc/" and "cd /etc" is that the
| > shell or the chdir() libc library function probably strips off the
| > trailing "/" before passing it to a system call, or perhaps the kernel
| > even ignores it.  "/etc/" is not different from "/etc".  So making mutt
| > behave the same, normalising paths, is reasonable.
| 
| I'm not 100% sure (as in, I haven't looked at the source), but I
| believe it's the kernel that handles this.

It is. With one tiny caveat...

If you have a symlink "foo" to a directory, then for certain
rare things "foo" will mean the symlink and "foo/" will mean the
directory. Specificly, "foo/" will not mean the symlink - it forces
traversal of the symlink.  "foo" may mean either, as it's a valid pathname
that will resolve to the directory, but some operations must see the
symlink of it is one (eg lstat). But in the noraml course of affairs an
app will always follow a symlink i.e.  open, chdir, chmod etc follow
symlinks. The whole point of symlinks is that they function just like
what they point to.

However, this is irrelevant to mutt. Like most things, it has no use
for symlinks (as symlinks) and should simply let them resolve. So the
patch seems sensible to me - strip trailing slahes for normalcy and sane
behaviour will result.

Cheers,
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

I die. Before I die my body turns hair-side-in. People come from everywhere to
see the insides of themselves. But the sight makes them lose the will, and all
die. O the embarrassment.       - Joe Haldeman, _A !Tangled Web_