summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2002-04-15 05:02:22 +0000
committerTim Potter <tpot@samba.org>2002-04-15 05:02:22 +0000
commitd9cfe0f3ebdcf053f79ee0bbba59d4dbe2831145 (patch)
treebdffbae91c0eef28bad9e1b3b092bc766d9f3150 /source3/rpcclient
parent59a04032c86a9304156946c6f71bb4b1375ab81b (diff)
downloadsamba-d9cfe0f3ebdcf053f79ee0bbba59d4dbe2831145.tar.gz
samba-d9cfe0f3ebdcf053f79ee0bbba59d4dbe2831145.tar.bz2
samba-d9cfe0f3ebdcf053f79ee0bbba59d4dbe2831145.zip
Merge of lsa lookup names/sids patch from HEAD.
(This used to be commit e57c162897d4a7e66bb87091d179ac138f751c64)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_lsarpc.c21
1 files changed, 11 insertions, 10 deletions
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]);