From 38b34cc3e529e185dd3b3d9f79ae74d1c9fac435 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 6 Jan 2013 14:41:24 +0100 Subject: [PATCH] smbd: Simplify an if-expression Reviewed-by: Jeremy Allison Reviewed-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- source3/smbd/uid.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c index b9cebce71ac..5ab0dc4e30c 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 && -- 2.11.4.GIT