summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
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)));