summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-09-04 09:28:26 +0200
committerVolker Lendecke <vl@samba.org>2012-09-26 16:29:28 +0200
commit1fa730deba0f36947775fe490b9be98a92560b3f (patch)
treecda8afa4c7e792b352f7a56ec625b245e5bd46fe /source3
parentcc58a19565870d62b3d3476b4b718fcd1ff94a46 (diff)
downloadsamba-1fa730deba0f36947775fe490b9be98a92560b3f.tar.gz
samba-1fa730deba0f36947775fe490b9be98a92560b3f.tar.bz2
samba-1fa730deba0f36947775fe490b9be98a92560b3f.zip
s3: Slightly simplify calculate_open_access_flags
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/open.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 8c24ef9ff1..1f9a372dfb 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1873,8 +1873,7 @@ static int calculate_open_access_flags(uint32_t access_mask,
int oplock_request,
uint32_t private_flags)
{
- int flags;
- bool need_write;
+ bool need_write, need_read;
/*
* Note that we ignore the append flag as append does not
@@ -1892,14 +1891,16 @@ static int calculate_open_access_flags(uint32_t access_mask,
/* DENY_DOS opens are always underlying read-write on the
file handle, no matter what the requested access mask
says. */
- if ((private_flags & NTCREATEX_OPTIONS_PRIVATE_DENY_DOS) ||
- access_mask & (FILE_READ_ATTRIBUTES|FILE_READ_DATA|
- FILE_READ_EA|FILE_EXECUTE)) {
- flags = O_RDWR;
- } else {
- flags = O_WRONLY;
+
+ need_read =
+ ((private_flags & NTCREATEX_OPTIONS_PRIVATE_DENY_DOS) ||
+ access_mask & (FILE_READ_ATTRIBUTES|FILE_READ_DATA|
+ FILE_READ_EA|FILE_EXECUTE));
+
+ if (!need_read) {
+ return O_WRONLY;
}
- return flags;
+ return O_RDWR;
}
/****************************************************************************