The branch, master has been updated
       via  c034ff7 s3: Slightly simplify is_stat_open
       via  34f2d189 s3: Make is_stat_open() a bit more readable
      from  849648c lib: Make async_sock includable on its own

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit c034ff7b1516f827ab4538613ec98daa170d9f25
Author: Volker Lendecke <[email protected]>
Date:   Wed Sep 5 15:24:46 2012 +0200

    s3: Slightly simplify is_stat_open
    
    The "access_bits" clause is redundant. is_stat_open says that exactly
    at least one of the stat_open_bits must be set and none else.
    
    Autobuild-User(master): Volker Lendecke <[email protected]>
    Autobuild-Date(master): Tue Sep 25 20:05:06 CEST 2012 on sn-devel-104

commit 34f2d189846de2cd134756d8f435370b69afb49d
Author: Volker Lendecke <[email protected]>
Date:   Wed Sep 5 15:19:28 2012 +0200

    s3: Make is_stat_open() a bit more readable

-----------------------------------------------------------------------

Summary of changes:
 source3/smbd/open.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index d142d96..34d5526 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1066,11 +1066,13 @@ static void validate_my_share_entries(struct 
smbd_server_connection *sconn,
 
 bool is_stat_open(uint32 access_mask)
 {
-       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));
+       const uint32_t stat_open_bits =
+               (SYNCHRONIZE_ACCESS|
+                FILE_READ_ATTRIBUTES|
+                FILE_WRITE_ATTRIBUTES);
+
+       return (((access_mask &  stat_open_bits) != 0) &&
+               ((access_mask & ~stat_open_bits) == 0));
 }
 
 /****************************************************************************


-- 
Samba Shared Repository

Reply via email to