From 592f6bb89ad160d81e5a658e45df590120df8b60 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Thu, 1 Jun 2023 13:40:05 +0900 Subject: w32: Fix hello_line parsing for fd passing. * tests/fdpassing.c (server_socket): Test with comma in the hello line. Signed-off-by: NIIBE Yutaka --- src/assuan-socket-connect.c | 2 +- tests/fdpassing.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/assuan-socket-connect.c b/src/assuan-socket-connect.c index 182f9b3..b2f3c76 100644 --- a/src/assuan-socket-connect.c +++ b/src/assuan-socket-connect.c @@ -137,7 +137,7 @@ _assuan_connect_finalize (assuan_context_t ctx, assuan_fd_t fd, int process_id = -1; /* Parse the message: OK ..., process %i */ - line = strchr (line, ','); + line = strrchr (line, ','); if (line) { line = strchr (line + 1, ' '); diff --git a/tests/fdpassing.c b/tests/fdpassing.c index 438c8c5..eef447f 100644 --- a/tests/fdpassing.c +++ b/tests/fdpassing.c @@ -229,6 +229,7 @@ server_socket (const char *socketname) log_fatal ("assuan_init_socket_server failed: %s\n", gpg_strerror (rc)); assuan_set_sock_nonce (ctx, &socket_nonce); + assuan_set_hello_line (ctx, "Hello, this is a socket server."); server_common (ctx); } -- cgit v1.2.3