From f2fc3a2dca56fcca71e0b677625d3cdb7946d5c1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 8 Jan 2000 11:32:00 +0000 Subject: 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) --- source3/smbd/open.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source3/smbd') 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)) || -- cgit