summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-01-08 01:23:13 +0000
committerJeremy Allison <jra@samba.org>2000-01-08 01:23:13 +0000
commitfaa302c7688eeb03f543d6dac817b5a80753a9f5 (patch)
tree36f3c2f8f62c1d20348a9b26e10d5a9a2cba65fe /source3
parent6e8548acb381499142e8d3b0a2eac2061e160b02 (diff)
downloadsamba-faa302c7688eeb03f543d6dac817b5a80753a9f5.tar.gz
samba-faa302c7688eeb03f543d6dac817b5a80753a9f5.tar.bz2
samba-faa302c7688eeb03f543d6dac817b5a80753a9f5.zip
Fixed deny mode bug :
: If a file is resident on NT and the first user opens it read/write with DENY_READ then a subsequent : attempt by a second user (running under Windows 95) to open it read/write DENY_NONE fails. : Under samba 2.0.5a the second open succeeds but the file is write only. Jeremy. (This used to be commit 974af581fe428fd0233c2516b16a5132b0e1b583)
Diffstat (limited to 'source3')
-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,