summaryrefslogtreecommitdiffhomepage
path: root/cli-auth.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2007-03-17 06:30:11 +0000
committerMatt Johnston <matt@ucc.asn.au>2007-03-17 06:30:11 +0000
commita4130263bd36edad8c4bd8b9daf729148f1c0d8f (patch)
tree718b3ea053c4c40ccba3d8138787487af236b1aa /cli-auth.c
parent0ffc17e48184077239a678af2b9334a1c094b1ec (diff)
Allow reading dbclient password from an environment var
--HG-- extra : convert_revision : 9a5277c058af96e8fb7a3ade558dd1aeeafa1d3a
Diffstat (limited to 'cli-auth.c')
-rw-r--r--cli-auth.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/cli-auth.c b/cli-auth.c
index 4c17a21..1024538 100644
--- a/cli-auth.c
+++ b/cli-auth.c
@@ -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);