summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/smbd/open.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index a940eda85d..2e4f54e40f 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -631,7 +631,7 @@ 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 == 0) return(AREAD);
+ 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
@@ -651,14 +651,14 @@ static int access_table(int new_deny,int old_deny,int old_mode,
switch (new_deny)
{
case DENY_WRITE:
- if (old_deny==DENY_WRITE && old_mode==0) return(AREAD);
- if (old_deny==DENY_READ && old_mode==0) return(AWRITE);
- if (old_deny==DENY_NONE && old_mode==0) return(AALL);
+ if (old_deny==DENY_WRITE && old_mode==DOS_OPEN_RDONLY) return(AREAD);
+ if (old_deny==DENY_READ && old_mode==DOS_OPEN_RDONLY) return(AWRITE);
+ if (old_deny==DENY_NONE && old_mode==DOS_OPEN_RDONLY) return(AALL);
return(AFAIL);
case DENY_READ:
- if (old_deny==DENY_WRITE && old_mode==1) return(AREAD);
- if (old_deny==DENY_READ && old_mode==1) return(AWRITE);
- if (old_deny==DENY_NONE && old_mode==1) return(AALL);
+ if (old_deny==DENY_WRITE && old_mode==DOS_OPEN_WRONLY) return(AREAD);
+ if (old_deny==DENY_READ && old_mode==DOS_OPEN_WRONLY) return(AWRITE);
+ if (old_deny==DENY_NONE && old_mode==DOS_OPEN_WRONLY) return(AALL);
return(AFAIL);
case DENY_NONE:
if (old_deny==DENY_WRITE) return(AREAD);
@@ -711,8 +711,8 @@ static int check_share_mode( share_mode_entry *share, int deny_mode,
if ((access_allowed == AFAIL) ||
(!fcbopen && (access_allowed == AREAD && *flags == O_RDWR)) ||
- (access_allowed == AREAD && *flags == O_WRONLY) ||
- (access_allowed == AWRITE && *flags == O_RDONLY))
+ (access_allowed == AREAD && *flags != O_RDONLY) ||
+ (access_allowed == AWRITE && *flags != O_WRONLY))
{
DEBUG(2,("Share violation on file (%d,%d,%d,%d,%s,fcbopen = %d, flags = %d) = %d\n",
deny_mode,old_deny_mode,old_open_mode,