summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-03-26 00:38:12 +0000
committerJeremy Allison <jra@samba.org>2002-03-26 00:38:12 +0000
commit81a0d5b5e92d7c8d5d426f8bd13d43ff394fe7e8 (patch)
treea17cd4422c33281e376fdd28c8537be6ce85cb12 /source3/smbd
parentbca0b0fc360d1d1566bf3341d583c6a124d12555 (diff)
downloadsamba-81a0d5b5e92d7c8d5d426f8bd13d43ff394fe7e8.tar.gz
samba-81a0d5b5e92d7c8d5d426f8bd13d43ff394fe7e8.tar.bz2
samba-81a0d5b5e92d7c8d5d426f8bd13d43ff394fe7e8.zip
Matched W2K *insane* open semantics....
Jeremy. (This used to be commit 6819e81da490914d2db91c4d2419d408b8d4c818)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/open.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index bcb866c378..29a854a397 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -408,6 +408,24 @@ static BOOL check_share_mode(connection_struct *conn, share_mode_entry *share, i
if ( !(desired_access & (FILE_READ_DATA|FILE_WRITE_DATA|FILE_APPEND_DATA|FILE_EXECUTE)) &&
!(share->desired_access & (FILE_READ_DATA|FILE_WRITE_DATA|FILE_APPEND_DATA|FILE_EXECUTE)) ) {
+
+ /*
+ * Wrinkle discovered by smbtorture....
+ * If both are non-io open and requester is asking for delete and current open has delete access
+ * but neither open has allowed file share delete then deny.... this is very strange and
+ * seems to be the only case in which non-io opens conflict. JRA.
+ */
+
+ if ((desired_access & DELETE_ACCESS) && (share->desired_access & DELETE_ACCESS) &&
+ (!GET_ALLOW_SHARE_DELETE(share->share_mode) || !GET_ALLOW_SHARE_DELETE(share_mode))) {
+ DEBUG(5,("check_share_mode: Failing open on file %s as delete access requests conflict.\n",
+ fname ));
+ unix_ERR_class = ERRDOS;
+ unix_ERR_code = ERRbadshare;
+
+ return False;
+ }
+
DEBUG(5,("check_share_mode: Allowing open on file %s as both desired access (0x%x) \
and existing desired access (0x%x) are non-data opens\n",
fname, (unsigned int)desired_access, (unsigned int)share->desired_access ));