lkml.org 
[lkml]   [2001]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
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

unlink(2)
...
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).

Andries


[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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

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