diff options
author | Jeremy Allison <jra@samba.org> | 2001-11-28 05:03:37 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-11-28 05:03:37 +0000 |
commit | a17867af97a258b9d22d6216d8de887174eaa707 (patch) | |
tree | 901d887da392a34d11df54c61a3bcfdae64937d0 /source3/smbd/trans2.c | |
parent | 1a50b36d978416e7c08423296db351e434bdea50 (diff) | |
download | samba-a17867af97a258b9d22d6216d8de887174eaa707.tar.gz samba-a17867af97a258b9d22d6216d8de887174eaa707.tar.bz2 samba-a17867af97a258b9d22d6216d8de887174eaa707.zip |
Ensure the CAN_WRITE is checked and prevents O_CREAT and O_TRUNC from
being set. Also prevent an open on a file on a readonly share from
setting delete on close.
Jeremy.
(This used to be commit 1f3dcd99bdd36cd3ff492394e80c3e2037a9aa48)
Diffstat (limited to 'source3/smbd/trans2.c')
-rw-r--r-- | source3/smbd/trans2.c | 9 |
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. */ |