Project

General

Profile

Bug #1701 ยป nlookup-mkdir.patch

c.turner, 03/29/2010 02:42 AM

View differences:

sys/kern/vfs_nlookup.c
nd->nl_nch = nch; /* remains locked */
/*
* Fast-track termination. There is no parent directory of
* the root in the same mount from the point of view of
* the caller so return EPERM if NLC_REFDVP is specified.
* e.g. 'rmdir /' is not allowed.
* Fast-track termination. In the case of '/', there is no
* parent directory from the point of view of the caller
* so return either EPERM if NLC_REFDVP is specified.
* e.g. 'rmdir /' is not allowed, or return EEXIST
* for the case of 'mkdir /'.
*/
if (*ptr == 0) {
if (nd->nl_flags & NLC_REFDVP)
error = EPERM;
error = (nd->nl_flags & NLC_CREATE) ? EEXIST : EPERM;
else
error = 0;
break;
    (1-1/1)