smbd: Simplify an if-expression
authorVolker Lendecke <vl@samba.org>
Sun, 6 Jan 2013 13:41:24 +0000 (14:41 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 9 Jan 2013 04:29:41 +0000 (15:29 +1100)
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/smbd/uid.c

index b9cebce..5ab0dc4 100644 (file)
@@ -145,16 +145,13 @@ NTSTATUS check_user_share_access(connection_struct *conn,
                                        readonly_share,
                                        session_info->security_token);
 
-       if ((share_access & FILE_WRITE_DATA) == 0) {
-               if ((share_access & FILE_READ_DATA) == 0) {
-                       /* No access, read or write. */
-                       DEBUG(0,("user %s connection to %s "
-                               "denied due to share security "
-                               "descriptor.\n",
-                               session_info->unix_info->unix_name,
-                               lp_servicename(talloc_tos(), snum)));
-                       return NT_STATUS_ACCESS_DENIED;
-               }
+       if ((share_access & (FILE_READ_DATA|FILE_WRITE_DATA)) == 0) {
+               /* No access, read or write. */
+               DEBUG(0,("user %s connection to %s denied due to share "
+                        "security descriptor.\n",
+                        session_info->unix_info->unix_name,
+                        lp_servicename(talloc_tos(), snum)));
+               return NT_STATUS_ACCESS_DENIED;
        }
 
        if (!readonly_share &&