summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/utils/net_dom.c13
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);