[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: minor mkdir bug fixes

From: Paul Eggert
Subject: Re: minor mkdir bug fixes
Date: Wed, 15 Jun 2005 01:52:25 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux)

address@hidden (David Feuer) writes:

> I'm not sure if this is a bug or not, but it smells fishy (I'm not working
> with a bleeding-edge coreutils, so I don't know if this is still there):
> In makepath.c:
>       /* If we've saved the cwd and DIRPATH is an absolute pathname,
>          we must chdir to `/' in order to enable the chdir optimization.
>          So if chdir ("/") fails, turn off the optimization.  */
>       if (do_chdir && *dirpath == '/' && chdir ("/") < 0)
>         do_chdir = false;
> As I understand it (perhaps incorrectly), the only time it might be
> possible to create a directory when it is impossible to chdir to one of
> its parents is when all but the last existing directory have their
> execute bits set.

Hmm, I didn't quite follow that.  But the above code is somethign
different.  It says that paths like /a/b/c must be handled by first
chdir("/"), whereas paths like a/b/c don't need that step.

> it should be possible to turn off the
> chdir optimization at any time in the process if a directory is reached
> that cannot be entered.

If it can't be chdir'ed into, then it can't be used at all, at least
if traditional Unix semantics are used.  (Or are you thinking ACLs?).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]