diff options
author | Andreas Schneider <asn@samba.org> | 2021-03-25 11:39:22 +0100 |
---|---|---|
committer | Ralph Boehme <slow@samba.org> | 2021-03-30 05:48:37 +0000 |
commit | 2bfe37e069fd267ced946d63cf97dc20fbb34f49 (patch) | |
tree | b637aa4455f15a9776c7346dd072c7ac24ba1d6f /source3 | |
parent | ccfb682f666acd4e2baaed5598d0e1ac37b0156e (diff) | |
download | samba-2bfe37e069fd267ced946d63cf97dc20fbb34f49.tar.gz |
s3:utils: Use libnetapi_set_creds() in net_dom
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_dom.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/source3/utils/net_dom.c b/source3/utils/net_dom.c index 1e45c59220c..25bf30736df 100644 --- a/source3/utils/net_dom.c +++ b/source3/utils/net_dom.c @@ -340,6 +340,7 @@ static int net_dom_renamecomputer(struct net_context *c, int argc, const char ** int net_dom(struct net_context *c, int argc, const char **argv) { NET_API_STATUS status; + struct cli_credentials *creds = NULL; struct functable func[] = { { @@ -374,15 +375,19 @@ int net_dom(struct net_context *c, int argc, const char **argv) {NULL, NULL, 0, NULL, NULL} }; + creds = net_context_creds(c, c); + if (creds == NULL) { + return -1; + } + status = libnetapi_net_init(&c->netapi_ctx); if (status != 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); + status = libnetapi_set_creds(c->netapi_ctx, creds); + if (status != 0) { + return -1; } return net_run_function(c, argc, argv, "net dom", func); |