summaryrefslogtreecommitdiffstats
path: root/readpass.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2019-11-15 00:32:40 +0000
committerDamien Miller <djm@mindrot.org>2019-11-15 13:41:40 +1100
commit018e2902a65c22faded215a7c588492c948f108c (patch)
treeecbffb2bed6e906b2fed0516bb41e2bc75def2ba /readpass.c
parent575d0042a94997c1eeb86a6dcfb30b3c7bdbcba3 (diff)
upstream: follow existing askpass logic for security key notifier:
fall back to _PATH_SSH_ASKPASS_DEFAULT if no $SSH_ASKPASS environment variable is set. OpenBSD-Commit-ID: cda753726b13fb797bf7a9f7a0b3022d9ade4520
Diffstat (limited to 'readpass.c')
-rw-r--r--readpass.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/readpass.c b/readpass.c
index b3e79903..42cbe41f 100644
--- a/readpass.c
+++ b/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.
*
@@ -228,8 +228,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;