[issue1701] mkdir / returns EPERM instead of EEXIST (related to pkg_add)

Alex Hornung (via DragonFly issue tracker) sinknull at leaf.dragonflybsd.org
Mon Mar 22 06:32:34 PDT 2010


Alex Hornung <ahornung at gmail.com> added the comment:

I can't take care of this this week, so I'll just give you the pointers:
The following lines in kern/vfs_nlookup.c are probably causing your issue. this
is called from many points, including from kern_mkdir to check if a directory
already exists. If nlookup returns EPERM, kern_mkdir just returns that.


    471 	    /*
    472 	     * Fast-track termination.  There is no parent directory of
    473 	     * the root in the same mount from the point of view of
    474 	     * the caller so return EPERM if NLC_REFDVP is specified.
    475 	     * e.g. 'rmdir /' is not allowed.
    476 	     */
    477 	    if (*ptr == 0) {
    478 		if (nd->nl_flags & NLC_REFDVP)
    479 			error = EPERM;
    480 		else
    481 			error = 0;
    482 		break;
    483 	    }
    484 	    continue;


Cheers,
Alex Hornung

----------
priority:  -> bug

_____________________________________________________
DragonFly issue tracker <bugs at lists.dragonflybsd.org>
<http://bugs.dragonflybsd.org/issue1701>
_____________________________________________________






More information about the Bugs mailing list