mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
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>
This commit is contained in:
parent
29f5372ffc
commit
ccfb682f66
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user