[lkml]   [2001]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectBug in unlink error return
Someone complained a moment ago about the error return in unlink.
And indeed, it used to be correct but since 2.1.132 we return a
buggy (or at least non-POSIX) error for unlink(directory).

Just changed the man page to say

EPERM The system does not allow unlinking of directories,
or unlinking of directories requires privileges
that the current process doesn't have. (This is
the POSIX prescribed error return.)

EISDIR pathname refers to a directory. (This is the non-
POSIX value returned by Linux since 2.1.132.)

Probably this should be fixed again, both in 2.2 and 2.4.
2.0 is still correct (I checked only ext2).


[The EISDIR is correct for rename(), and the cleanup that
made a nice uniform may_delete() in namei.c introduced this bug.
The very simple but slightly ugly fix is to write (in vfs_unlink)
error = may_delete(dir, dentry, 0);
if (error == -EISDIR)
error = -EPERM;
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:53    [W:0.036 / U:0.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site