summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-09-05 15:19:28 +0200
committerVolker Lendecke <vl@samba.org>2012-09-25 09:23:28 -0700
commit34f2d189846de2cd134756d8f435370b69afb49d (patch)
treebeea5949350e8cea40236ad186c067f2144bd430 /source3/smbd
parent849648cdb2ee07d5a0ec687bf5eba900db5c9001 (diff)
downloadsamba-34f2d189846de2cd134756d8f435370b69afb49d.tar.gz
samba-34f2d189846de2cd134756d8f435370b69afb49d.tar.bz2
samba-34f2d189846de2cd134756d8f435370b69afb49d.zip
s3: Make is_stat_open() a bit more readable
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/open.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index d142d960f7..eff78d4533 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1066,11 +1066,14 @@ static void validate_my_share_entries(struct smbd_server_connection *sconn,
bool is_stat_open(uint32 access_mask)
{
+ const uint32_t stat_open_bits =
+ (SYNCHRONIZE_ACCESS|
+ FILE_READ_ATTRIBUTES|
+ FILE_WRITE_ATTRIBUTES);
+
return (access_mask &&
- ((access_mask & ~(SYNCHRONIZE_ACCESS| FILE_READ_ATTRIBUTES|
- FILE_WRITE_ATTRIBUTES))==0) &&
- ((access_mask & (SYNCHRONIZE_ACCESS|FILE_READ_ATTRIBUTES|
- FILE_WRITE_ATTRIBUTES)) != 0));
+ ((access_mask & ~stat_open_bits) == 0) &&
+ ((access_mask & stat_open_bits) != 0));
}
/****************************************************************************