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