summaryrefslogtreecommitdiff
path: root/source4/ntvfs/posix/pvfs_open.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-10-25 04:24:58 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:04:38 -0500
commit5c95896499dd6f72c8fc9be84b0da880571731da (patch)
tree41a9d98474925f5bbf85b96a81214b8cdb82d95f /source4/ntvfs/posix/pvfs_open.c
parentced8ad3d04df4de84c0d88c2a427a1fa35f0c046 (diff)
downloadsamba-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_open.c')
-rw-r--r--source4/ntvfs/posix/pvfs_open.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c
index badd18d370..b66b3725db 100644
--- a/source4/ntvfs/posix/pvfs_open.c
+++ b/source4/ntvfs/posix/pvfs_open.c
@@ -723,17 +723,24 @@ NTSTATUS pvfs_change_create_options(struct pvfs_state *pvfs,
/*
- determine if a file is open - used to prevent some operations on open files
+ determine if a file can be deleted, or if it is prevented by an
+ already open file
*/
-BOOL pvfs_is_open(struct pvfs_state *pvfs, struct pvfs_filename *name)
+NTSTATUS pvfs_can_delete(struct pvfs_state *pvfs, struct pvfs_filename *name)
{
NTSTATUS status;
DATA_BLOB key;
status = pvfs_locking_key(name, name, &key);
if (!NT_STATUS_IS_OK(status)) {
- return False;
+ return NT_STATUS_NO_MEMORY;
}
- return odb_is_open(pvfs->odb_context, &key);
+ status = odb_can_open(pvfs->odb_context, &key,
+ NTCREATEX_SHARE_ACCESS_READ |
+ NTCREATEX_SHARE_ACCESS_WRITE |
+ NTCREATEX_SHARE_ACCESS_DELETE,
+ 0, STD_RIGHT_DELETE_ACCESS);
+
+ return status;
}