struct dom_sid *domain_sid;
char* domain_name;
char* acct_name;
+ const char *pwd = NULL;
fstring pdc_name;
union lsa_PolicyInformation *info = NULL;
struct dcerpc_binding_handle *b;
SAFE_FREE(acct_name);
return -1;
}
+ cli_credentials_set_username(c->creds, acct_name, CRED_SPECIFIED);
/*
* opt_workgroup will be used by connection functions further,
c->opt_workgroup = smb_xstrdup(domain_name);
};
- c->opt_user_name = acct_name;
- c->opt_user_specified = true;
-
/* find the domain controller */
if (!net_find_pdc(&server_ss, pdc_name, domain_name)) {
DEBUG(0, ("Couldn't find domain controller for domain %s\n", domain_name));
* Store the password in secrets db
*/
- if (!pdb_set_trusteddom_pw(domain_name, c->opt_password, domain_sid)) {
+ pwd = cli_credentials_get_password(c->creds);
+
+ if (!pdb_set_trusteddom_pw(domain_name, pwd, domain_sid)) {
DEBUG(0, ("Storing password for trusted domain failed.\n"));
cli_shutdown(cli);
talloc_destroy(mem_ctx);