Date: Sat, 7 Nov 2009 11:21:16 +0100 From: Gary Jennejohn <gary.jennejohn@freenet.de> To: Alexander Best <alexbestms@math.uni-muenster.de> Cc: freebsd-hackers@FreeBSD.org Subject: Re: rmdir(2) and mkdir(2) both return EISDIR for argument "/" Message-ID: <20091107112116.50eb45ee@ernst.jennejohn.org> In-Reply-To: <permail-20091106210949f0889e8400000862-a_best01@message-id.uni-muenster.de> References: <20091106182308.14dffc50@ernst.jennejohn.org> <permail-20091106210949f0889e8400000862-a_best01@message-id.uni-muenster.de>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 06 Nov 2009 22:09:49 +0100 (CET) Alexander Best <alexbestms@math.uni-muenster.de> wrote: > here's a completely new patch. all the changes are in kern/vfs_syscall.c. so > kern/vfs_lookup.c now stays just the way it is (please revert any changes from > the previous patches i posted). > > after applying the patch this is the output from a slightly modified version > of the test app i attached in my very first post: > > rmdir errno: 16 (EBUSY) <- EBUSY is required by POSIX > mkdir errno: 17 (EEXIST) > rename errno: 22 (EINVAL) > > these are the results when called with "/" as arg. the output doesn't differ > if run with or without superuser privileges. > > when run with "." as arg this is the output as regular user: > > rmdir errno: 22 (EINVAL) > mkdir errno: 17 (EEXIST) > rename errno: 13 (EACCES) > > and as superuser: > > rmdir errno: 22 (EINVAL) > mkdir errno: 17 (EEXIST) > rename errno: 22 (EINVAL) > > does this look reasonable? would be nice if mkdir and rmdir would also check > privileges at first like rename, but that's a different story i guess. ;) > The only problem I see with this is that vfs_syscall.c now has knowledge about the internal details of vfs_lookup.c Maybe just mention in the comments that this is the case and could be a problem if vfs_lookup.c is changed for some reason? That's what I do when I have to use something like this. But we don't want to turn this into a gigantic bikeshed - we already have enough of those. --- Gary Jennejohn
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20091107112116.50eb45ee>