diff options
-rw-r--r-- | source3/smbd/open.c | 11 |
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)); } /**************************************************************************** |