summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-01-26 10:06:23 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-01-26 10:06:23 +0000
commit84ce7ec0a4e84255bae7591c8b9214d59a75ab93 (patch)
tree0cd42dd4189ad40e94876658cd86210f3981a033
parentb1da5c02535ec61991d19cf09abaf366927ef34e (diff)
downloadsamba-84ce7ec0a4e84255bae7591c8b9214d59a75ab93.tar.gz
samba-84ce7ec0a4e84255bae7591c8b9214d59a75ab93.tar.bz2
samba-84ce7ec0a4e84255bae7591c8b9214d59a75ab93.zip
Make a talloc'ed copy of this strings so we can pass the right kind of pointer
to the function. This fixes a nice little segfault the brute-force-casting created. :-) Andrew Bartlett (This used to be commit c84fa7f5fd62940e397d3353fb688f283349393e)
-rw-r--r--source3/rpcclient/cmd_lsarpc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/rpcclient/cmd_lsarpc.c b/source3/rpcclient/cmd_lsarpc.c
index f6d0569de9..67efbb1ff7 100644
--- a/source3/rpcclient/cmd_lsarpc.c
+++ b/source3/rpcclient/cmd_lsarpc.c
@@ -81,6 +81,7 @@ static NTSTATUS cmd_lsa_lookup_names(struct cli_state *cli,
uint32 *types;
int num_names, i;
fstring name, domain;
+ const char *name2, *domain2;
if (argc == 1) {
printf("Usage: %s [name1 [name2 [...]]]\n", argv[0]);
@@ -98,8 +99,11 @@ static NTSTATUS cmd_lsa_lookup_names(struct cli_state *cli,
split_domain_name(argv[1], domain, name);
+ name2 = talloc_strdup(mem_ctx, name);
+ domain2 = talloc_strdup(mem_ctx, domain);
+
result = cli_lsa_lookup_names(cli, mem_ctx, &pol, argc - 1,
- (const char**)&domain, (const char**)&name, &sids,
+ &domain2, &name2, &sids,
&types, &num_names);
if (!NT_STATUS_IS_OK(result))