summaryrefslogtreecommitdiffstats
path: root/source/smbd/open.c
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
commit3f7fea58e8da6d98acadaabf0498ea2e88ea5678 (patch)
treeaef7fb936b5984a930ff53faf4dbb3e28785851a /source/smbd/open.c
parente21aa4cb088f348139309d29c85c48c8b777cff5 (diff)
downloadsamba-3f7fea58e8da6d98acadaabf0498ea2e88ea5678.tar.gz
samba-3f7fea58e8da6d98acadaabf0498ea2e88ea5678.tar.xz
samba-3f7fea58e8da6d98acadaabf0498ea2e88ea5678.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
Diffstat (limited to 'source/smbd/open.c')
-rw-r--r--source/smbd/open.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/smbd/open.c b/source/smbd/open.c
index 2e4f54e40f1..57f90b78b4f 100644
--- a/source/smbd/open.c
+++ b/source/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)) ||