Пример #1
0
void cli_init_creds(struct cli_state *cli, const char *username, const char *domain, const char *password)
{
	fstrcpy(cli->domain, domain);
	fstrcpy(cli->user_name, username);
	pwd_set_cleartext(&cli->pwd, password);
	if (!*username) {
		cli->pwd.null_pwd = true;
	}

        DEBUG(10,("cli_init_creds: user %s domain %s\n", cli->user_name, cli->domain));
}
Пример #2
0
static void init_creds(struct ntuser_creds *creds, const char* username,
		       const char* domain, const char* password, int pass_len)
{
	ZERO_STRUCTP(creds);

	pwd_set_cleartext(&creds->pwd, password);

	fstrcpy(creds->user_name, username);
	fstrcpy(creds->domain, domain);

	if (!*username) {
		creds->pwd.null_pwd = True;
	}
}
Пример #3
0
void init_rpcclient_creds(struct ntuser_creds *creds, char* username,
			  char* domain, char* password)
{
	ZERO_STRUCTP(creds);
	
	if (lp_encrypted_passwords()) {
		pwd_make_lm_nt_16(&creds->pwd, password);
	} else {
		pwd_set_cleartext(&creds->pwd, password);
	}

	fstrcpy(creds->user_name, username);
	fstrcpy(creds->domain, domain);
}
Пример #4
0
/****************************************************************************
reads a password
****************************************************************************/
void pwd_read(struct pwd_info *pwd, char *passwd_report, BOOL do_encrypt)
{
	/* grab a password */
	char *user_pass;

	pwd_init(pwd);

	user_pass = (char*)getpass(passwd_report);

	if (user_pass == NULL || user_pass[0] == 0)
	{
		pwd_set_nullpwd(pwd);
	}
	else if (do_encrypt)
	{
		pwd_make_lm_nt_16(pwd, user_pass);
	}
	else
	{
		pwd_set_cleartext(pwd, user_pass);
	}
}