Allow reading dbclient password from an environment var

--HG--
extra : convert_revision : 9a5277c058af96e8fb7a3ade558dd1aeeafa1d3a
This commit is contained in:
Matt Johnston
2007-03-17 06:30:11 +00:00
parent 0ffc17e481
commit a4130263bd
2 changed files with 17 additions and 0 deletions

View File

@@ -284,6 +284,15 @@ void cli_auth_try() {
char* getpass_or_cancel(char* prompt)
{
char* password = NULL;
#ifdef DROPBEAR_PASSWORD_ENV
/* Password provided in an environment var */
password = getenv(DROPBEAR_PASSWORD_ENV);
if (password)
{
return password;
}
#endif
password = getpass(prompt);