diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-10-25 04:24:58 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:04:38 -0500 |
commit | 5c95896499dd6f72c8fc9be84b0da880571731da (patch) | |
tree | 41a9d98474925f5bbf85b96a81214b8cdb82d95f /source4/ntvfs/posix/pvfs_rename.c | |
parent | ced8ad3d04df4de84c0d88c2a427a1fa35f0c046 (diff) | |
download | samba-5c95896499dd6f72c8fc9be84b0da880571731da.tar.gz samba-5c95896499dd6f72c8fc9be84b0da880571731da.tar.bz2 samba-5c95896499dd6f72c8fc9be84b0da880571731da.zip |
r3189: improved the share_conflict() logic (both in terms of readability and
correctness). pvfs now passes the BASE-RENAME test.
(This used to be commit 4cf3f65a5c19fdad62a0bdef225b2d9002cf8c8b)
Diffstat (limited to 'source4/ntvfs/posix/pvfs_rename.c')
-rw-r--r-- | source4/ntvfs/posix/pvfs_rename.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source4/ntvfs/posix/pvfs_rename.c b/source4/ntvfs/posix/pvfs_rename.c index 89d6a0da14..6116f6c7bf 100644 --- a/source4/ntvfs/posix/pvfs_rename.c +++ b/source4/ntvfs/posix/pvfs_rename.c @@ -48,9 +48,14 @@ NTSTATUS pvfs_rename(struct ntvfs_module_context *ntvfs, return status; } - if (pvfs_is_open(pvfs, name1) || - pvfs_is_open(pvfs, name2)) { - return NT_STATUS_SHARING_VIOLATION; + status = pvfs_can_delete(pvfs, name1); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + status = pvfs_can_delete(pvfs, name2); + if (!NT_STATUS_IS_OK(status)) { + return status; } if (name1->has_wildcard || name2->has_wildcard) { |