summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/readpass.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2019-11-15 00:32:40 +0000
committerdjm <djm@openbsd.org>2019-11-15 00:32:40 +0000
commit6e93bb8e05ec4cc3912fcf3ec231b61512807d82 (patch)
tree1aad4720c5e386420e5f30a53e055b780654fe9f /usr.bin/ssh/readpass.c
parentlibusb was renamed to libusbhid in 2001 but the old DPADD var name was (diff)
downloadwireguard-openbsd-6e93bb8e05ec4cc3912fcf3ec231b61512807d82.tar.xz
wireguard-openbsd-6e93bb8e05ec4cc3912fcf3ec231b61512807d82.zip
follow existing askpass logic for security key notifier: fall back
to _PATH_SSH_ASKPASS_DEFAULT if no $SSH_ASKPASS environment variable is set.
Diffstat (limited to 'usr.bin/ssh/readpass.c')
-rw-r--r--usr.bin/ssh/readpass.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/ssh/readpass.c b/usr.bin/ssh/readpass.c
index a93d1fa5461..e6b4123fcf0 100644
--- a/usr.bin/ssh/readpass.c
+++ b/usr.bin/ssh/readpass.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: readpass.c,v 1.56 2019/11/12 22:35:02 djm Exp $ */
+/* $OpenBSD: readpass.c,v 1.57 2019/11/15 00:32:40 djm Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
*
@@ -225,8 +225,9 @@ notify_start(int force_askpass, const char *fmt, ...)
free(prompt);
return NULL;
}
- if (getenv("DISPLAY") == NULL ||
- (askpass = getenv("SSH_ASKPASS")) == NULL || *askpass == '\0') {
+ if ((askpass = getenv("SSH_ASKPASS")) == NULL)
+ askpass = _PATH_SSH_ASKPASS_DEFAULT;
+ if (getenv("DISPLAY") == NULL || *askpass == '\0') {
debug3("%s: cannot notify", __func__);
free(prompt);
return NULL;