summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-11-23 14:28:45 +0100
committerVolker Lendecke <vl@samba.org>2010-11-24 16:07:55 +0100
commit8d28ae10d278d6d2a738d55f47404651a20c17f4 (patch)
tree62f1486d633591da71dadcdafd4b57e87bce5a59 /source3
parentf10dd12b1474bafaf2906b10ed960d1afc92f91c (diff)
downloadsamba-8d28ae10d278d6d2a738d55f47404651a20c17f4.tar.gz
samba-8d28ae10d278d6d2a738d55f47404651a20c17f4.tar.bz2
samba-8d28ae10d278d6d2a738d55f47404651a20c17f4.zip
s3: Correctly calculate the wbinfo -s result
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_client/cli_lsarpc.c34
1 files changed, 25 insertions, 9 deletions
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<hunk_num_sids; i++) {
+ if (hunk_types[i] == SID_NAME_UNKNOWN) {
+ have_unmapped = true;
+ } else {
+ have_mapped = true;
+ }
+ }
}
sids_left -= hunk_num_sids;
@@ -369,7 +378,14 @@ static NTSTATUS rpccli_lsa_lookup_sids_generic(struct rpc_pipe_client *cli,
*pdomains = domains;
*pnames = names;
*ptypes = types;
- return result;
+
+ if (!have_mapped) {
+ return NT_STATUS_NONE_MAPPED;
+ }
+ if (have_unmapped) {
+ return STATUS_SOME_UNMAPPED;
+ }
+ return NT_STATUS_OK;
fail:
TALLOC_FREE(domains);