rename() is supposed to fail when the target exists and is not a
directory only if the source is a directory. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25144 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
acb16f5574
commit
fd4a010b05
@ -1015,6 +1015,10 @@ bfs_rename(fs_volume *_volume, fs_vnode *_oldDir, const char *oldName,
|
||||
if (vnode.Get(&other) < B_OK)
|
||||
return B_NAME_IN_USE;
|
||||
|
||||
// only allowed, if either both nodes are directories or neither is
|
||||
if (inode->IsDirectory() != other->IsDirectory())
|
||||
return other->IsDirectory() ? B_IS_A_DIRECTORY : B_NOT_A_DIRECTORY;
|
||||
|
||||
status = newDirectory->Remove(transaction, newName, NULL,
|
||||
other->IsDirectory());
|
||||
if (status < B_OK)
|
||||
|
Loading…
x
Reference in New Issue
Block a user