diff options
author | Andreas Schneider <asn@samba.org> | 2021-03-24 14:37:26 +0100 |
---|---|---|
committer | Ralph Boehme <slow@samba.org> | 2021-03-30 05:48:37 +0000 |
commit | ccfb682f666acd4e2baaed5598d0e1ac37b0156e (patch) | |
tree | b78160c0d8a55c4160657a5436d2310d25fe9d04 /source3 | |
parent | 29f5372ffccfe722a6a1f0aaad4dcb4484511b51 (diff) | |
download | samba-ccfb682f666acd4e2baaed5598d0e1ac37b0156e.tar.gz |
s3:utils: Use libnetapi_set_creds() in net_rpc_shell
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/utils/net_rpc_shell.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/source3/utils/net_rpc_shell.c b/source3/utils/net_rpc_shell.c index 2569bb06869..ab7df7ef463 100644 --- a/source3/utils/net_rpc_shell.c +++ b/source3/utils/net_rpc_shell.c @@ -222,19 +222,26 @@ int net_rpc_shell(struct net_context *c, int argc, const char **argv) NTSTATUS status; struct rpc_sh_ctx *ctx; struct dom_sid_buf buf; + struct cli_credentials *creds = NULL; + NET_API_STATUS net_api_status; if (argc != 0 || c->display_usage) { d_printf("%s\nnet rpc shell\n", _("Usage:")); return -1; } + creds = net_context_creds(c, c); + if (creds == NULL) { + return -1; + } + if (libnetapi_net_init(&c->netapi_ctx) != 0) { return -1; } - libnetapi_set_username(c->netapi_ctx, c->opt_user_name); - libnetapi_set_password(c->netapi_ctx, c->opt_password); - if (c->opt_kerberos) { - libnetapi_set_use_kerberos(c->netapi_ctx); + + net_api_status = libnetapi_set_creds(c->netapi_ctx, creds); + if (net_api_status != 0) { + return -1; } ctx = talloc(NULL, struct rpc_sh_ctx); |