summaryrefslogtreecommitdiff
path: root/source3/smbd/trans2.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd/trans2.c')
-rw-r--r--source3/smbd/trans2.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 0e13d8d87a..aaa5aade97 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -1680,6 +1680,15 @@ static int call_trans2qfilepathinfo(connection_struct *conn,
NTSTATUS set_delete_on_close_internal(files_struct *fsp, BOOL delete_on_close)
{
/*
+ * Only allow delete on close for writable shares.
+ */
+
+ if (delete_on_close && !CAN_WRITE(fsp->conn)) {
+ DEBUG(10,("set_delete_on_close_internal: file %s delete on close flag set but write access denied on share.\n",
+ fsp->fsp_name ));
+ return NT_STATUS_ACCESS_DENIED;
+ }
+ /*
* Only allow delete on close for files/directories opened with delete intent.
*/