From 25806314daef8d2958b63bc429c9973c2755a865 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 7 Mar 2024 14:56:45 +0100 Subject: [PATCH] s3:net: finally remove net_context->opt_{user_specified,user_name,password} Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- source3/utils/net.c | 7 ------- source3/utils/net.h | 3 --- source3/utils/net_util.c | 10 ---------- source3/utils/py_net.c | 2 -- 4 files changed, 22 deletions(-) diff --git a/source3/utils/net.c b/source3/utils/net.c index 126dc324028..cc31bb53d09 100644 --- a/source3/utils/net.c +++ b/source3/utils/net.c @@ -1373,8 +1373,6 @@ static struct functable net_func[] = { cli_credentials_get_principal_obtained(c->creds); enum credentials_obtained password_obtained = cli_credentials_get_password_obtained(c->creds); - enum credentials_obtained username_obtained = - CRED_UNINITIALISED; uint32_t gensec_features; if (principal_obtained == CRED_SPECIFIED) { @@ -1384,11 +1382,6 @@ static struct functable net_func[] = { c->explicit_credentials = true; } - c->opt_user_name = cli_credentials_get_username_and_obtained( - c->creds, - &username_obtained); - c->opt_user_specified = (username_obtained == CRED_SPECIFIED); - c->opt_workgroup = cli_credentials_get_domain(c->creds); gensec_features = cli_credentials_get_gensec_features(c->creds); diff --git a/source3/utils/net.h b/source3/utils/net.h index 36660664aa0..8540a6db9d4 100644 --- a/source3/utils/net.h +++ b/source3/utils/net.h @@ -42,9 +42,6 @@ struct cli_state; struct net_context { const char *opt_requester_name; const char *opt_host; - const char *opt_password; - const char *opt_user_name; - bool opt_user_specified; bool explicit_credentials; const char *opt_workgroup; int opt_long_list_entries; diff --git a/source3/utils/net_util.c b/source3/utils/net_util.c index 1168983e0b4..93e08cafbf1 100644 --- a/source3/utils/net_util.c +++ b/source3/utils/net_util.c @@ -259,21 +259,11 @@ NTSTATUS connect_dst_pipe(struct net_context *c, struct cli_state **cli_dst, int net_use_krb_machine_account(struct net_context *c) { - char *user_name = NULL; - if (!secrets_init()) { d_fprintf(stderr,_("ERROR: Unable to open secrets database\n")); exit(1); } - c->opt_password = secrets_fetch_machine_password( - c->opt_target_workgroup, NULL, NULL); - if (asprintf(&user_name, "%s$@%s", lp_netbios_name(), lp_realm()) == -1) { - return -1; - } - c->opt_user_name = user_name; - c->opt_user_specified = true; - cli_credentials_set_machine_account(c->creds, c->lp_ctx); c->explicit_credentials = true; return 0; diff --git a/source3/utils/py_net.c b/source3/utils/py_net.c index 61b549bd9a1..95cc59f33b4 100644 --- a/source3/utils/py_net.c +++ b/source3/utils/py_net.c @@ -128,8 +128,6 @@ static PyObject *py_net_join_member(py_net_Object *self, PyObject *args, PyObjec c->creds = self->creds; c->explicit_credentials = true; - c->opt_user_name = cli_credentials_get_username(self->creds); - c->opt_password = cli_credentials_get_password(self->creds); werr = libnet_Join(mem_ctx, r); if (W_ERROR_EQUAL(werr, WERR_NERR_DCNOTFOUND)) { -- 2.11.4.GIT