From 8d28ae10d278d6d2a738d55f47404651a20c17f4 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 23 Nov 2010 14:28:45 +0100 Subject: s3: Correctly calculate the wbinfo -s result --- source3/rpc_client/cli_lsarpc.c | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) (limited to 'source3') diff --git a/source3/rpc_client/cli_lsarpc.c b/source3/rpc_client/cli_lsarpc.c index 1b1c072456..29cb09cddd 100644 --- a/source3/rpc_client/cli_lsarpc.c +++ b/source3/rpc_client/cli_lsarpc.c @@ -289,6 +289,8 @@ static NTSTATUS rpccli_lsa_lookup_sids_generic(struct rpc_pipe_client *cli, char **domains = NULL; char **names = NULL; enum lsa_SidType *types = NULL; + bool have_mapped = false; + bool have_unmapped = false; if (num_sids) { if (!(domains = TALLOC_ARRAY(mem_ctx, char *, num_sids))) { @@ -348,14 +350,21 @@ static NTSTATUS rpccli_lsa_lookup_sids_generic(struct rpc_pipe_client *cli, goto fail; } - /* adapt overall result */ - if (( NT_STATUS_IS_OK(result) && - !NT_STATUS_IS_OK(hunk_result)) - || - ( NT_STATUS_EQUAL(result, NT_STATUS_NONE_MAPPED) && - !NT_STATUS_EQUAL(hunk_result, NT_STATUS_NONE_MAPPED))) - { - result = STATUS_SOME_UNMAPPED; + if (NT_STATUS_IS_OK(hunk_result)) { + have_mapped = true; + } + if (NT_STATUS_EQUAL(hunk_result, NT_STATUS_NONE_MAPPED)) { + have_unmapped = true; + } + if (NT_STATUS_EQUAL(hunk_result, STATUS_SOME_UNMAPPED)) { + int i; + for (i=0; i