namei() returns EISDIR for "/" (Re: svn commit: r203990 - head/lib/libc/sys)

Gary Jennejohn gary.jennejohn at freenet.de
Mon Mar 1 17:23:35 UTC 2010


On Sun, 28 Feb 2010 18:26:05 -0800
Garrett Cooper <yanefbsd at gmail.com> wrote:

> On Sun, Feb 28, 2010 at 5:11 PM, Alexander Best <alexbestms at wwu.de> wrote:
> > i have a small test app to check {rm|mk}dir()'s errnos with certain args like
> > /, ., /proc and non-empty dirs. i'll submit it to this thread as soon as i
> > also add testcases for syscalls like rename(), unlink(), etc.
> >
> > most of the errno codes returned after applying your patch look correct. i
> > wonder however why rmdir("/proc") returns EACCESS as unprivileged user.
> > wouldn't it make more sense to also return EBUSY? why complain about
> > permission related matters when even root won't be able to perform the
> > operation.
> 
> Hmm.. good question. POSIX doesn't fully expound on this case
> (http://www.opengroup.org/onlinepubs/009695399/functions/rmdir.html),
> and either seem possible...
> 

This maybe from rmdir(2)?

[EACCES]           Write permission is denied on the directory containing
                   the link to be removed.

ls -ldo /
drwxr-xr-x  44 root  wheel  - 1536 Feb 28 18:36 /

ls -ldo /proc
dr-xr-xr-x  2 root  wheel  - 512 Sep  7  2008 /proc

---
Gary Jennejohn


More information about the freebsd-hackers mailing list