summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2022-12-02 08:16:07 +0100
committerNIIBE Yutaka <gniibe@fsij.org>2022-12-02 08:16:07 +0100
commit7c6b014d3bc6ea4237dd46c99f3a3d570796851b (patch)
tree497c251caeed594cee48fb0792c206bb86037062
parenttests: Fix make check-all. (diff)
downloadgnupg2-7c6b014d3bc6ea4237dd46c99f3a3d570796851b.tar.xz
gnupg2-7c6b014d3bc6ea4237dd46c99f3a3d570796851b.zip
tests: Fix fake-pinentry for Windows.
* tests/openpgp/fake-pinentry.c (main): Override PINENTRY_USER_DATA, by the option. -- In the Assuan implementation for Windows, spawn function doesn't call the atfork callback. Thus, the environment variable is not updated by gpg-agent when it spawns pinentry. Reliable way is the interaction to override the option. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
-rw-r--r--tests/openpgp/fake-pinentry.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/tests/openpgp/fake-pinentry.c b/tests/openpgp/fake-pinentry.c
index fb0c6ae1b..02c4e0d13 100644
--- a/tests/openpgp/fake-pinentry.c
+++ b/tests/openpgp/fake-pinentry.c
@@ -201,7 +201,6 @@ main (int argc, char **argv)
{
char *args;
char *option_user_data = NULL;
- int got_environment_user_data;
char *logfile;
char *passphrasefile;
char *passphrase;
@@ -213,7 +212,6 @@ main (int argc, char **argv)
setvbuf (stdout, NULL, _IOLBF, BUFSIZ);
args = getenv ("PINENTRY_USER_DATA");
- got_environment_user_data = !!args;
if (! args)
args = "";
@@ -290,12 +288,7 @@ main (int argc, char **argv)
}
else if (strncmp (buffer, OPT_USER_DATA, strlen (OPT_USER_DATA)) == 0)
{
- if (got_environment_user_data)
- {
- reply ("OK - I already got the data from the environment.\n");
- continue;
- }
-
+ /* Prefer interactive data to the one from environment variable. */
if (log_stream)
fclose (log_stream);
log_stream = NULL;