summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-01-08 11:32:00 +0000
committerAndrew Tridgell <tridge@samba.org>2000-01-08 11:32:00 +0000
commitf2fc3a2dca56fcca71e0b677625d3cdb7946d5c1 (patch)
treee90cdb636ddc88efc9c3bb297e165922ba5ca136 /source3/smbd
parente8b5cb45155536107a71e1106ad4a624eb559496 (diff)
downloadsamba-f2fc3a2dca56fcca71e0b677625d3cdb7946d5c1.tar.gz
samba-f2fc3a2dca56fcca71e0b677625d3cdb7946d5c1.tar.bz2
samba-f2fc3a2dca56fcca71e0b677625d3cdb7946d5c1.zip
fix a error in access_table revealed by the new deny test in smbtorture. We now exactly match NT for normal files. We still don't match for *.exe files though
(This used to be commit 3f7fea58e8da6d98acadaabf0498ea2e88ea5678)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/open.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 2e4f54e40f..57f90b78b4 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -631,8 +631,6 @@ static int access_table(int new_deny,int old_deny,int old_mode,
if (old_deny == new_deny && share_pid == pid)
return(AALL);
- if (old_mode == DOS_OPEN_RDONLY) return(AREAD);
-
/* the new smbpub.zip spec says that if the file extension is
.com, .dll, .exe or .sym then allow the open. I will force
it to read-only as this seems sensible although the spec is
@@ -645,6 +643,10 @@ static int access_table(int new_deny,int old_deny,int old_mode,
return(AREAD);
}
+ if (old_deny == DENY_READ || new_deny == DENY_READ) return AFAIL;
+ if (old_mode == DOS_OPEN_RDONLY) return(AREAD);
+
+
return(AFAIL);
}
@@ -707,7 +709,7 @@ static int check_share_mode( share_mode_entry *share, int deny_mode,
{
int access_allowed = access_table(deny_mode,old_deny_mode,old_open_mode,
- share->pid,fname);
+ share->pid,fname);
if ((access_allowed == AFAIL) ||
(!fcbopen && (access_allowed == AREAD && *flags == O_RDWR)) ||