1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

s3:net: finally remove net_context->opt_{user_specified,user_name,password}

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
Stefan Metzmacher 2024-03-07 14:56:45 +01:00
parent a1ab1c8620
commit 25806314da
4 changed files with 0 additions and 22 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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)) {