summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-07-19 18:45:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:38:15 -0500
commit201bd24ac39552fb22772a8eed69ccdba0b2c9e8 (patch)
tree49eb9614a043f7817726d08b86cdc5546d3d6213
parentdada5b4853ec7d7346e075ae0718eea9e64cb7b6 (diff)
downloadsamba-201bd24ac39552fb22772a8eed69ccdba0b2c9e8.tar.gz
samba-201bd24ac39552fb22772a8eed69ccdba0b2c9e8.tar.bz2
samba-201bd24ac39552fb22772a8eed69ccdba0b2c9e8.zip
r17142: Ensure we record the correct can_read/can_write
from the client requested access mask. Jeremy. (This used to be commit 12490fafc7f98952bf709c4c504f8f2b5646f197)
-rw-r--r--source3/smbd/open.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 2abd367597..890f1ef45a 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -190,7 +190,8 @@ static NTSTATUS open_file(files_struct *fsp,
SMB_STRUCT_STAT *psbuf,
int flags,
mode_t unx_mode,
- uint32 access_mask)
+ uint32 access_mask, /* client requested access mask. */
+ uint32 open_access_mask) /* what we're actually using in the open. */
{
int accmode = (flags & O_ACCMODE);
int local_flags = flags;
@@ -244,7 +245,7 @@ static NTSTATUS open_file(files_struct *fsp,
local_flags = (flags & ~O_ACCMODE)|O_RDWR;
}
- if ((access_mask & (FILE_READ_DATA|FILE_WRITE_DATA|FILE_APPEND_DATA|FILE_EXECUTE)) ||
+ if ((open_access_mask & (FILE_READ_DATA|FILE_WRITE_DATA|FILE_APPEND_DATA|FILE_EXECUTE)) ||
(!file_existed && (local_flags & O_CREAT)) ||
((local_flags & O_TRUNC) == O_TRUNC) ) {
@@ -1547,7 +1548,8 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
* open_file strips any O_TRUNC flags itself.
*/
- fsp_open = open_file(fsp,conn,fname,psbuf,flags|flags2,unx_mode, open_access_mask);
+ fsp_open = open_file(fsp,conn,fname,psbuf,flags|flags2,unx_mode,
+ access_mask, open_access_mask);
if (!NT_STATUS_IS_OK(fsp_open)) {
if (lck != NULL) {
@@ -1814,7 +1816,7 @@ NTSTATUS open_file_fchmod(connection_struct *conn, const char *fname,
/* note! we must use a non-zero desired access or we don't get
a real file descriptor. Oh what a twisted web we weave. */
- status = open_file(fsp,conn,fname,psbuf,O_WRONLY,0,FILE_WRITE_DATA);
+ status = open_file(fsp,conn,fname,psbuf,O_WRONLY,0,FILE_WRITE_DATA,FILE_WRITE_DATA);
/*
* This is not a user visible file open.