diff options
author | Werner Koch <[email protected]> | 2025-03-14 13:04:36 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2025-04-02 09:19:23 +0000 |
commit | 9448d01d61e5bfe48e18f6b3f75d9332dc4aa5fe (patch) | |
tree | 095ab1c20b1bb07b2e24343fe41e6416d9521b9b | |
parent | gpgconf: Fix reload and kill of keyboxd. (diff) | |
download | gnupg-9448d01d61e5bfe48e18f6b3f75d9332dc4aa5fe.tar.gz gnupg-9448d01d61e5bfe48e18f6b3f75d9332dc4aa5fe.zip |
scd,w32: Fix posssible lockup due to lost select results.
* scd/scdaemon.c (handle_connections) [W32]: Do not continue the loop
when an event was encountered.
--
Here the event handle is passed to npth_eselect so that this function
can detect the event and reset the event. There is no need to consume
this information here. However, npth_select might also got a ready
file descriptor along with the event and by doing a "continue" we
would miss the ready state of the file descriptor. The fix is to do
nothing here, similar to what we do in gpg-agent.
Fixes-commit: f9acc7d18bb90f47dafe7e32ae92f567756d6b12
GnuPG-bug-id: 2982
(cherry picked from commit a7ec3792c5d1891180265c946bc021cd8a205e54)
-rw-r--r-- | scd/scdaemon.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scd/scdaemon.c b/scd/scdaemon.c index 09498ebab..96179202a 100644 --- a/scd/scdaemon.c +++ b/scd/scdaemon.c @@ -1395,8 +1395,11 @@ handle_connections (gnupg_fd_t listen_fd) ret = npth_eselect (nfd+1, &read_fdset, NULL, NULL, t, events, &events_set); saved_errno = errno; - if (events_set & 1) - continue; + if ((events_set & 1)) + { + if (opt.debug) + log_debug ("the_event seen and reset by npth_eselect\n"); + } #endif if (ret == -1 && saved_errno != EINTR) |