svn commit: samba r17142 - in branches/SAMBA_3_0/source/smbd: .
jra at samba.org
jra at samba.org
Wed Jul 19 18:45:25 GMT 2006
Author: jra
Date: 2006-07-19 18:45:25 +0000 (Wed, 19 Jul 2006)
New Revision: 17142
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=17142
Log:
Ensure we record the correct can_read/can_write
from the client requested access mask.
Jeremy.
Modified:
branches/SAMBA_3_0/source/smbd/open.c
Changeset:
Modified: branches/SAMBA_3_0/source/smbd/open.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/open.c 2006-07-19 18:35:07 UTC (rev 17141)
+++ branches/SAMBA_3_0/source/smbd/open.c 2006-07-19 18:45:25 UTC (rev 17142)
@@ -190,7 +190,8 @@
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 @@
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 @@
* 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 @@
/* 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.
More information about the samba-cvs
mailing list