summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-10-29 12:36:30 +0100
committerGünther Deschner <gd@samba.org>2009-10-30 12:28:48 +0100
commit820b2f4cfaf0d5a954ed3bbf3e6b74ccdbfebe70 (patch)
treeaeedba746b12a515e8ffff3e6aa92891a6ddf1f8
parent5e8c86c558360ea3c507dae5b3088aa1c2c97bb4 (diff)
downloadsamba-820b2f4cfaf0d5a954ed3bbf3e6b74ccdbfebe70.tar.gz
samba-820b2f4cfaf0d5a954ed3bbf3e6b74ccdbfebe70.tar.bz2
samba-820b2f4cfaf0d5a954ed3bbf3e6b74ccdbfebe70.zip
s3-lsa: use switch in _lsa_QuerySecurity().
Guenther
-rw-r--r--source3/rpc_server/srv_lsa_nt.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c
index d90dfeed98..a806a22907 100644
--- a/source3/rpc_server/srv_lsa_nt.c
+++ b/source3/rpc_server/srv_lsa_nt.c
@@ -2089,15 +2089,19 @@ NTSTATUS _lsa_QuerySecurity(pipes_struct *p,
if (!find_policy_by_hnd(p, r->in.handle, (void **)(void *)&handle))
return NT_STATUS_INVALID_HANDLE;
- if (handle->type == LSA_HANDLE_POLICY_TYPE) {
+ switch (handle->type) {
+ case LSA_HANDLE_POLICY_TYPE:
status = make_lsa_object_sd(p->mem_ctx, &psd, &sd_size,
&lsa_policy_mapping, NULL, 0);
- } else if (handle->type == LSA_HANDLE_ACCOUNT_TYPE) {
+ break;
+ case LSA_HANDLE_ACCOUNT_TYPE:
status = make_lsa_object_sd(p->mem_ctx, &psd, &sd_size,
&lsa_account_mapping,
&handle->sid, LSA_ACCOUNT_ALL_ACCESS);
- } else {
+ break;
+ default:
status = NT_STATUS_INVALID_HANDLE;
+ break;
}
if (!NT_STATUS_IS_OK(status)) {