1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-06-20 20:47:58 +02:00

Revert "w32: On socket nonce mismatch close the socket."

--

The commit was entirely bogus because the check_nonce function closes
the socket itself if it returns with true.  Thus closing the socket by
the caller in the true case was bogus.

The more likely cause for the hangs on Windows are in scdaemon:

  * scd: Fix posssible lockup on Windows due to a lost select
    result.  [rGa7ec3792c5]

GnuPG-bug-id: 7434
Fixes-commit: 73f6c2dd4d3e5b58faf69821726988ae984fad89.
This commit is contained in:
Werner Koch 2025-05-14 10:34:46 +02:00
parent 40cfa71281
commit 645cf7d8fc
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
4 changed files with 11 additions and 19 deletions

View File

@ -4400,7 +4400,7 @@ register_commands (assuan_context_t ctx)
/* Startup the server. If LISTEN_FD and FD is given as -1, this is a
simple pipe server, otherwise it is a regular server. CTRL is the
simple piper server, otherwise it is a regular server. CTRL is the
control structure for this connection; it has only the basic
initialization. */
void

View File

@ -2877,9 +2877,8 @@ start_connection_thread_std (void *arg)
if (check_nonce (ctrl, &socket_nonce))
{
log_error ("handler 0x%lx for fd %d FAILED nonce check\n",
(unsigned long) npth_self(), FD_DBG (ctrl->thread_startup.fd));
assuan_sock_close (ctrl->thread_startup.fd);
log_error ("handler 0x%lx nonce check FAILED\n",
(unsigned long) npth_self());
return NULL;
}
@ -2895,9 +2894,8 @@ start_connection_thread_extra (void *arg)
if (check_nonce (ctrl, &socket_nonce_extra))
{
log_error ("handler 0x%lx for fd %d FAILED nonce check\n",
(unsigned long) npth_self(), FD_DBG (ctrl->thread_startup.fd));
assuan_sock_close (ctrl->thread_startup.fd);
log_error ("handler 0x%lx nonce check FAILED\n",
(unsigned long) npth_self());
return NULL;
}
@ -2914,9 +2912,8 @@ start_connection_thread_browser (void *arg)
if (check_nonce (ctrl, &socket_nonce_browser))
{
log_error ("handler 0x%lx for fd %d FAILED nonce check\n",
(unsigned long) npth_self(), FD_DBG (ctrl->thread_startup.fd));
assuan_sock_close (ctrl->thread_startup.fd);
log_error ("handler 0x%lx nonce check FAILED\n",
(unsigned long) npth_self());
return NULL;
}
@ -2932,10 +2929,7 @@ start_connection_thread_ssh (void *arg)
ctrl_t ctrl = arg;
if (check_nonce (ctrl, &socket_nonce_ssh))
{
assuan_sock_close (ctrl->thread_startup.fd);
return NULL;
}
active_connections++;
agent_init_default_ctrl (ctrl);

View File

@ -2272,8 +2272,7 @@ start_connection_thread (void *arg)
if (check_nonce (fd, &socket_nonce))
{
log_error ("handler for fd %d FAILED nonce check\n", FD_DBG (fd));
assuan_sock_close (fd);
log_error ("handler nonce check FAILED\n");
return NULL;
}

View File

@ -1448,9 +1448,8 @@ start_connection_thread (void *arg)
if (check_nonce (ctrl, &socket_nonce))
{
log_error ("handler 0x%lx for fd %d FAILED nonce check\n",
(unsigned long) npth_self(), FD_DBG (ctrl->thread_startup.fd));
assuan_sock_close (ctrl->thread_startup.fd);
log_error ("handler 0x%lx nonce check FAILED\n",
(unsigned long) npth_self());
return NULL;
}