summaryrefslogtreecommitdiff
path: root/source4/ntvfs/posix/pvfs_setfileinfo.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-02-28 03:47:02 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:52:08 -0500
commit40a8d58551526a0f367d23d0c9603a5b9d86b270 (patch)
treeecc25f71a1ae366b757e711c8f69bd206903092e /source4/ntvfs/posix/pvfs_setfileinfo.c
parente3e048630be2fbf20d580850e5673ad372bd34f0 (diff)
downloadsamba-40a8d58551526a0f367d23d0c9603a5b9d86b270.tar.gz
samba-40a8d58551526a0f367d23d0c9603a5b9d86b270.tar.bz2
samba-40a8d58551526a0f367d23d0c9603a5b9d86b270.zip
r13739: a fairly major overhaul of the opendb code to allow the BASE-DELETE
test to pass. To try to make the code a bit more understandable, I moved to using an IDL description of the opendb tdb record format. One of the larger changes was to make directory opens and creates go via the opendb code, so directory operations now obey all the share mode restrictions, as well as delete on close semantics. I also changed the period over which the opendb locks are held, to try to minimise races due to two open operations happening at the same time. (This used to be commit cd2602d05725e1734b0862131dd91601c6b6d51a)
Diffstat (limited to 'source4/ntvfs/posix/pvfs_setfileinfo.c')
-rw-r--r--source4/ntvfs/posix/pvfs_setfileinfo.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/source4/ntvfs/posix/pvfs_setfileinfo.c b/source4/ntvfs/posix/pvfs_setfileinfo.c
index 0753ccb40b..69c9cd5e4a 100644
--- a/source4/ntvfs/posix/pvfs_setfileinfo.c
+++ b/source4/ntvfs/posix/pvfs_setfileinfo.c
@@ -121,6 +121,8 @@ static NTSTATUS pvfs_setfileinfo_rename(struct pvfs_state *pvfs,
/* if the destination exists, then check the rename is allowed */
if (name2->exists) {
+ struct odb_lock *lck;
+
if (strcmp(name2->full_name, name->full_name) == 0) {
/* rename to same name is null-op */
return NT_STATUS_OK;
@@ -130,7 +132,7 @@ static NTSTATUS pvfs_setfileinfo_rename(struct pvfs_state *pvfs,
return NT_STATUS_OBJECT_NAME_COLLISION;
}
- status = pvfs_can_delete(pvfs, req, name2);
+ status = pvfs_can_delete(pvfs, req, name2, &lck);
if (NT_STATUS_EQUAL(status, NT_STATUS_SHARING_VIOLATION)) {
return NT_STATUS_ACCESS_DENIED;
}
@@ -243,7 +245,6 @@ NTSTATUS pvfs_setfileinfo(struct ntvfs_module_context *ntvfs,
struct utimbuf unix_times;
struct pvfs_file *f;
struct pvfs_file_handle *h;
- uint32_t create_options;
struct pvfs_filename newstats;
NTSTATUS status;
uint32_t access_needed;
@@ -322,13 +323,8 @@ NTSTATUS pvfs_setfileinfo(struct ntvfs_module_context *ntvfs,
case RAW_SFILEINFO_DISPOSITION_INFO:
case RAW_SFILEINFO_DISPOSITION_INFORMATION:
- create_options = h->create_options;
- if (info->disposition_info.in.delete_on_close) {
- create_options |= NTCREATEX_OPTIONS_DELETE_ON_CLOSE;
- } else {
- create_options &= ~NTCREATEX_OPTIONS_DELETE_ON_CLOSE;
- }
- return pvfs_change_create_options(pvfs, req, f, create_options);
+ return pvfs_set_delete_on_close(pvfs, req, f,
+ info->disposition_info.in.delete_on_close);
case RAW_SFILEINFO_ALLOCATION_INFO:
case RAW_SFILEINFO_ALLOCATION_INFORMATION: