summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-02-23 02:20:54 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:55:43 -0500
commit34a5c5a580102afe1503da911d6e3b61191bb325 (patch)
tree65a9bf7f8a4255ff20f67dcfa3732e8e20158966 /source3
parent139ce45d7a82e76a58ae6b9021977569ecbe17fa (diff)
downloadsamba-34a5c5a580102afe1503da911d6e3b61191bb325.tar.gz
samba-34a5c5a580102afe1503da911d6e3b61191bb325.tar.bz2
samba-34a5c5a580102afe1503da911d6e3b61191bb325.zip
r5513: Fix for bug #2201 - use same logic with "delete readonly"
when setting the delete on close flag as we do in SMBunlink calls. Jeremy. (This used to be commit 7a94eaf1811c79ae52ee78b1cd9cfc691e1d65a0)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/trans2.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index e8090792b0..b241aa38f4 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -2958,10 +2958,12 @@ NTSTATUS set_delete_on_close_internal(files_struct *fsp, BOOL delete_on_close, u
* Only allow delete on close for writable files.
*/
- if (dosmode & aRONLY) {
- DEBUG(10,("set_delete_on_close_internal: file %s delete on close flag set but file attribute is readonly.\n",
- fsp->fsp_name ));
- return NT_STATUS_CANNOT_DELETE;
+ if (!lp_delete_readonly(SNUM(fsp->conn))) {
+ if (dosmode & aRONLY) {
+ DEBUG(10,("set_delete_on_close_internal: file %s delete on close flag set but file attribute is readonly.\n",
+ fsp->fsp_name ));
+ return NT_STATUS_CANNOT_DELETE;
+ }
}
/*