From d9cfe0f3ebdcf053f79ee0bbba59d4dbe2831145 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Mon, 15 Apr 2002 05:02:22 +0000 Subject: Merge of lsa lookup names/sids patch from HEAD. (This used to be commit e57c162897d4a7e66bb87091d179ac138f751c64) --- source3/rpcclient/cmd_lsarpc.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'source3/rpcclient') diff --git a/source3/rpcclient/cmd_lsarpc.c b/source3/rpcclient/cmd_lsarpc.c index 99f1fbc3ce..56ae4c6e68 100644 --- a/source3/rpcclient/cmd_lsarpc.c +++ b/source3/rpcclient/cmd_lsarpc.c @@ -78,7 +78,7 @@ static NTSTATUS cmd_lsa_lookup_names(struct cli_state *cli, NTSTATUS result = NT_STATUS_UNSUCCESSFUL; DOM_SID *sids; uint32 *types; - int num_names, i; + int i; if (argc == 1) { printf("Usage: %s [name1 [name2 [...]]]\n", argv[0]); @@ -93,15 +93,15 @@ static NTSTATUS cmd_lsa_lookup_names(struct cli_state *cli, goto done; result = cli_lsa_lookup_names(cli, mem_ctx, &pol, argc - 1, - (const char**)(argv + 1), &sids, - &types, &num_names); + (const char**)(argv + 1), &sids, &types); - if (!NT_STATUS_IS_OK(result)) + if (!NT_STATUS_IS_OK(result) && + NT_STATUS_V(result) != NT_STATUS_V(STATUS_SOME_UNMAPPED)) goto done; /* Print results */ - for (i = 0; i < num_names; i++) { + for (i = 0; i < (argc - 1); i++) { fstring sid_str; sid_to_string(sid_str, &sids[i]); @@ -124,7 +124,7 @@ static NTSTATUS cmd_lsa_lookup_sids(struct cli_state *cli, TALLOC_CTX *mem_ctx, char **domains; char **names; uint32 *types; - int num_names, i; + int i; if (argc == 1) { printf("Usage: %s [sid1 [sid2 [...]]]\n", argv[0]); @@ -147,20 +147,21 @@ static NTSTATUS cmd_lsa_lookup_sids(struct cli_state *cli, TALLOC_CTX *mem_ctx, goto done; } - for (i = 0; i < argc - 1; i++) + for (i = 0; i < (argc - 1); i++) string_to_sid(&sids[i], argv[i + 1]); /* Lookup the SIDs */ result = cli_lsa_lookup_sids(cli, mem_ctx, &pol, argc - 1, sids, - &domains, &names, &types, &num_names); + &domains, &names, &types); - if (!NT_STATUS_IS_OK(result)) + if (!NT_STATUS_IS_OK(result) && + NT_STATUS_V(result) != NT_STATUS_V(STATUS_SOME_UNMAPPED)) goto done; /* Print results */ - for (i = 0; i < num_names; i++) { + for (i = 0; i < (argc - 1); i++) { fstring sid_str; sid_to_string(sid_str, &sids[i]); -- cgit