aboutsummaryrefslogtreecommitdiffstats
path: root/g10/server.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2017-02-03 11:04:52 +0000
committerWerner Koch <[email protected]>2017-02-03 11:05:16 +0000
commit7052a0d77cf8f3a445b252a809d29be445788625 (patch)
tree7bc9e2f54b13fe3d7da92ce53b05e7090b609882 /g10/server.c
parentgpg: Don't assume that strtoul interprets "" as 0. (diff)
downloadgnupg-7052a0d77cf8f3a445b252a809d29be445788625.tar.gz
gnupg-7052a0d77cf8f3a445b252a809d29be445788625.zip
gpg: More diagnostics for a launched pinentry.
* agent/call-pinentry.c (start_pinentry): Call getinfo/ttyinfo. * g10/server.c (gpg_proxy_pinentry_notify): Simplify the output so that we do not change the code when adding new fields to PINENTRY_LAUNCHED. -- This patch changes the --verbose output of gpg to show for example gpg: pinentry launched (5228 gtk2 1.0.1-beta10 \ /dev/pts/4 xterm localhost:10.0) the used tty, its type, and the value of DISPLAY in addiion to the pid, flavor, and version. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g10/server.c')
-rw-r--r--g10/server.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/g10/server.c b/g10/server.c
index b89f0be69..e3a3bad22 100644
--- a/g10/server.c
+++ b/g10/server.c
@@ -770,18 +770,15 @@ gpg_server (ctrl_t ctrl)
gpg_error_t
gpg_proxy_pinentry_notify (ctrl_t ctrl, const unsigned char *line)
{
- if (opt.verbose)
- {
- char *linecopy = xtrystrdup (line);
- char *fields[4];
-
- if (linecopy
- && split_fields (linecopy, fields, DIM (fields)) >= 4
- && !strcmp (fields[0], "PINENTRY_LAUNCHED"))
- log_info (_("pinentry launched (pid %s, flavor %s, version %s)\n"),
- fields[1], fields[2], fields[3]);
+ const char *s;
- xfree (linecopy);
+ if (opt.verbose
+ && !strncmp (line, "PINENTRY_LAUNCHED", 17)
+ && (line[17]==' '||!line[17]))
+ {
+ for (s = line + 17; *s && spacep (s); s++)
+ ;
+ log_info (_("pinentry launched (%s)\n"), s);
}
if (!ctrl || !ctrl->server_local