Re: permissions not honoured by /bin/pwd aka getcwd

From: Peter Chubb (
Date: Thu Feb 24 2000 - 16:55:07 EST

>>>>> "Alan" == Alan Curry <> writes:

Alan> Harald Kirsch writes the following:
>> The point is that on all other *nixes (as reported in the Tcl-newsgroup)
>> the behaviour is different. getcwd does return `permission denied' if
>> the x-flag of the current dir or any of its parents is not present.
>> But maybe all other systems are not POSIX and Linux is or Linux knows
>> better than POSIX?

Alan> You might get a better response if you can point to the POSIX requirement
Alan> that getcwd() behave specifically as you describe, or that the system is not
Alan> allowed to have additional syscalls that provide slightly more information
Alan> than is available through opendir/readdir/etc.

The posix.1 spec for getcwd says this:

    (section each of the following conditions, if the
    condition is detected, the getcwd() function shall return a value
    of NULL and set errno to the corresponding value:

    [EACCESS] Read or search permission was denied for a component of
               the pathname.

The Posix.2 spec for /bin/pwd does not impose the same restrictions ---
/bin/pwd always works (barring disk errors).

Peter C

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

This archive was generated by hypermail 2b29 : Tue Feb 29 2000 - 21:00:10 EST