summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-01-06 14:41:24 +0100
committerAndrew Bartlett <abartlet@samba.org>2013-01-09 15:29:41 +1100
commit38b34cc3e529e185dd3b3d9f79ae74d1c9fac435 (patch)
treef67b10a52d72a43a01168528b677d1b336eea916
parent17708821ffc2d0cb771e8c5cb6415b87e20d6a0a (diff)
downloadsamba-38b34cc3e529e185dd3b3d9f79ae74d1c9fac435.tar.gz
samba-38b34cc3e529e185dd3b3d9f79ae74d1c9fac435.tar.bz2
samba-38b34cc3e529e185dd3b3d9f79ae74d1c9fac435.zip
smbd: Simplify an if-expression
Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r--source3/smbd/uid.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c
index b9cebce71a..5ab0dc4e30 100644
--- a/source3/smbd/uid.c
+++ b/source3/smbd/uid.c
@@ -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 &&