From 5746c944cd78e196454af00b7fcef68ad1079c3d Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Fri, 28 Jun 2024 13:51:22 +0900 Subject: [PATCH] agent: Require use of "SCD DEVINFO --watch" command with socket. * agent/call-scd.c (agent_card_devinfo): Check if client connects by a socket. -- GnuPG-bug-id: 7151 Signed-off-by: NIIBE Yutaka (cherry picked from commit c4ff9c5def1aaf76f7cec82d9aa7e5cb1b77f044) --- agent/call-scd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/agent/call-scd.c b/agent/call-scd.c index f8b4cb6a1..da0539153 100644 --- a/agent/call-scd.c +++ b/agent/call-scd.c @@ -1185,6 +1185,9 @@ agent_card_devinfo (ctrl_t ctrl, void *assuan_context) int rc; gnupg_fd_t client_fds[2]; + if (ctrl->thread_startup.fd == GNUPG_INVALID_FD) + return GPG_ERR_INV_HANDLE; + rc = daemon_start (DAEMON_SCD, ctrl, 1); if (rc) return rc;