From 5c95896499dd6f72c8fc9be84b0da880571731da Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 25 Oct 2004 04:24:58 +0000 Subject: 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) --- source4/ntvfs/posix/pvfs_rename.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'source4/ntvfs/posix/pvfs_rename.c') 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) { -- cgit