diff options
Diffstat (limited to 'source4/ntvfs/posix/pvfs_setfileinfo.c')
-rw-r--r-- | source4/ntvfs/posix/pvfs_setfileinfo.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source4/ntvfs/posix/pvfs_setfileinfo.c b/source4/ntvfs/posix/pvfs_setfileinfo.c index 8892c92c3c..0de87b8584 100644 --- a/source4/ntvfs/posix/pvfs_setfileinfo.c +++ b/source4/ntvfs/posix/pvfs_setfileinfo.c @@ -33,6 +33,7 @@ NTSTATUS pvfs_setfileinfo(struct ntvfs_module_context *ntvfs, struct pvfs_state *pvfs = ntvfs->private_data; struct utimbuf unix_times; struct pvfs_file *f; + uint32_t create_options; f = pvfs_find_fd(pvfs, req, info->generic.file.fnum); if (!f) { @@ -65,6 +66,18 @@ NTSTATUS pvfs_setfileinfo(struct ntvfs_module_context *ntvfs, return NT_STATUS_ACCESS_DENIED; } break; + case RAW_SFILEINFO_DISPOSITION_INFO: + if (!(f->access_mask & STD_RIGHT_DELETE_ACCESS)) { + return NT_STATUS_ACCESS_DENIED; + } + create_options = f->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 NT_STATUS_OK; } |