[Discuss] really odd GCC bug? under Ubuntu
Bill Bogstad
bogstad at pobox.com
Sat May 11 17:50:33 EDT 2013
On Sat, May 11, 2013 at 5:11 PM, Richard Pieri <richard.pieri at gmail.com> wrote:
> Bill Bogstad wrote:
>> ls: cannot access foo/bar: Permission denied
>
> Precisely. You get a different error if the file is unreadable than you
> get when it doesn't exist:
>
> $ mkdir foo
> $ echo bar >foo/bar
> $ mv foo foo.old
> $ cat foo/bar
> cat: foo/bar: No such file or directory
I think I understand our misunderstanding. You said:
> Yeah, that doesn't do what you think it does. It makes /usr/local
> unreadable but it doesn't make /usr/local/bin unreadable. Same for the
> rest of the subdirs under /usr/local. Which leads to permissions weirdness.
I thought you meant that /usr/local/bin can be "read" if the
/usr/local directory is not "executable".
This is clearly not the case.
What I now understand you to have meant is that there are different
error codes for "doesn't exist" and "you don't have permission" which
is certainly true. Of course "you don't have permission" might mean
that you don't have permission
to even determine if the object exists, not that it exists; but
permissions on the object itself preclude your accessing it.
Directory vs. file permissions can be very important when hard links
allow the same file contents to be accessible in
different directories which might have completely different
permissions so I wanted to make sure that I understood what
you were saying.
In any case, I still don't think that GCC should treat those different
error codes differently, but they are certainly different and for
whatever reason it does.
Bill Bogstad
More information about the Discuss
mailing list