summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-12-06 17:16:33 -0800
committerJeremy Allison <jra@samba.org>2007-12-06 17:16:33 -0800
commit1b92ea5559bfa00016103508feac9a06ea4b66ae (patch)
treec11509a3fc07e7c828e1b40e4259f80d1fc0bf2e /source3/utils
parent9bd35ef153ef4b7f892dcf9e69c2232b940a9e18 (diff)
downloadsamba-1b92ea5559bfa00016103508feac9a06ea4b66ae.tar.gz
samba-1b92ea5559bfa00016103508feac9a06ea4b66ae.tar.bz2
samba-1b92ea5559bfa00016103508feac9a06ea4b66ae.zip
Remove pstrings from client/client.c by doing a large rewrite.
Mostly compiles.... Jeremy. (This used to be commit c87f3eba9aa52f4ab25d77e2167262bf5c43b1a6)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_rpc_shell.c14
-rw-r--r--source3/utils/smbcacls.c9
2 files changed, 16 insertions, 7 deletions
diff --git a/source3/utils/net_rpc_shell.c b/source3/utils/net_rpc_shell.c
index c9d57fcab7..fb0b5cfe4e 100644
--- a/source3/utils/net_rpc_shell.c
+++ b/source3/utils/net_rpc_shell.c
@@ -237,15 +237,17 @@ int net_rpc_shell(int argc, const char **argv)
d_printf("Talking to domain %s (%s)\n", ctx->domain_name,
sid_string_static(ctx->domain_sid));
-
+
this_ctx = ctx;
while(1) {
- char *prompt;
- char *line;
+ char *prompt = NULL;
+ char *line = NULL;
int ret;
- asprintf(&prompt, "%s> ", this_ctx->whoami);
+ if (asprintf(&prompt, "%s> ", this_ctx->whoami) < 0) {
+ break;
+ }
line = smb_readline(prompt, NULL, completion_fn);
SAFE_FREE(prompt);
@@ -256,18 +258,22 @@ int net_rpc_shell(int argc, const char **argv)
ret = poptParseArgvString(line, &argc, &argv);
if (ret == POPT_ERROR_NOARG) {
+ SAFE_FREE(line);
continue;
}
if (ret != 0) {
d_fprintf(stderr, "cmdline invalid: %s\n",
poptStrerror(ret));
+ SAFE_FREE(line);
return False;
}
if ((line[0] != '\n') &&
(!net_sh_process(this_ctx, argc, argv))) {
+ SAFE_FREE(line);
break;
}
+ SAFE_FREE(line);
}
cli_shutdown(ctx->cli);
diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c
index 861aea0713..e3f94cd458 100644
--- a/source3/utils/smbcacls.c
+++ b/source3/utils/smbcacls.c
@@ -827,9 +827,12 @@ static struct cli_state *connect_one(const char *server, const char *share)
if (NT_STATUS_IS_OK(nt_status = cli_full_connection(&c, global_myname(), server,
&ss, 0,
share, "?????",
- cmdline_auth_info.username, lp_workgroup(),
- cmdline_auth_info.password, 0,
- cmdline_auth_info.signing_state, NULL))) {
+ get_cmdline_auth_info_username(),
+ lp_workgroup(),
+ get_cmdline_auth_info_password(),
+ 0,
+ get_cmdline_auth_info.signing_state(),
+ NULL))) {
return c;
} else {
DEBUG(0,("cli_full_connection failed! (%s)\n", nt_errstr(nt_status)));