summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-12-16 18:47:03 +0100
committerVolker Lendecke <vl@samba.org>2012-01-03 13:38:01 +0100
commit49a520217ceb04cbd4278a3bce7cb1f8dd04b018 (patch)
tree02568781df313baacfd847ed57e4afbab97940fc /source3/smbd
parent8cadd19a91cc4cded493b9ba5dec821f93dcfb54 (diff)
downloadsamba-49a520217ceb04cbd4278a3bce7cb1f8dd04b018.tar.gz
samba-49a520217ceb04cbd4278a3bce7cb1f8dd04b018.tar.bz2
samba-49a520217ceb04cbd4278a3bce7cb1f8dd04b018.zip
s3: Remove some else{} branches in smbd_calculate_maximum_allowed_access
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/open.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 6d7b634bbb..db4831d3d2 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1486,7 +1486,10 @@ static NTSTATUS smbd_calculate_maximum_allowed_access(
if (get_current_uid(conn) == (uid_t)0) {
*p_access_mask |= FILE_GENERIC_ALL;
- } else if (file_existed) {
+ return NT_STATUS_OK;
+ }
+
+ if (file_existed) {
struct security_descriptor *sd;
uint32_t access_granted = 0;
@@ -1523,9 +1526,10 @@ static NTSTATUS smbd_calculate_maximum_allowed_access(
}
*p_access_mask = (access_granted | FILE_READ_ATTRIBUTES);
- } else {
- *p_access_mask = FILE_GENERIC_ALL;
+ return NT_STATUS_OK;
}
+
+ *p_access_mask = FILE_GENERIC_ALL;
return NT_STATUS_OK;
}