aboutsummaryrefslogtreecommitdiffstats
path: root/tools/gpg-connect-agent.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2007-10-01 14:48:39 +0000
committerWerner Koch <[email protected]>2007-10-01 14:48:39 +0000
commit31c19d1d685b75377d9ff6dfbc9138ecbd5600b4 (patch)
treef6630bee0deef3ff050b3ca7dbb55e4951e34372 /tools/gpg-connect-agent.c
parentSupport the SETQUALITYBAR command of recent pinentries. (diff)
downloadgnupg-31c19d1d685b75377d9ff6dfbc9138ecbd5600b4.tar.gz
gnupg-31c19d1d685b75377d9ff6dfbc9138ecbd5600b4.zip
Use Assuan socket wrapper calls.
Made socket servers secure under Windows.
Diffstat (limited to '')
-rw-r--r--tools/gpg-connect-agent.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/gpg-connect-agent.c b/tools/gpg-connect-agent.c
index 5322a4fc5..2300b7f88 100644
--- a/tools/gpg-connect-agent.c
+++ b/tools/gpg-connect-agent.c
@@ -29,7 +29,7 @@
#include "i18n.h"
#include "../common/util.h"
#include "../common/asshelp.h"
-
+#include "../common/sysutils.h"
/* Constants to identify the commands and options. */
@@ -244,7 +244,7 @@ do_sendfd (assuan_context_t ctx, char *line)
log_error ("file `%s' opened in \"%s\" mode, fd=%d\n",
name, mode, fd);
- rc = assuan_sendfd (ctx, fd);
+ rc = assuan_sendfd (ctx, INT2FD (fd) );
if (rc)
log_error ("sednig descriptor %d failed: %s\n", fd, gpg_strerror (rc));
fclose (fp);
@@ -360,6 +360,16 @@ main (int argc, char **argv)
}
else
ctx = start_agent ();
+
+ /* See whether there is a line pending from the server (in case
+ assuan did not run the initial handshaking). */
+ if (assuan_pending_line (ctx))
+ {
+ rc = read_and_print_response (ctx);
+ if (rc)
+ log_info (_("receiving line failed: %s\n"), gpg_strerror (rc) );
+ }
+
line = NULL;
linesize = 0;
for (;;)