]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
ask-password: remove files in /run when query is aborted 40549/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 2 Feb 2026 14:16:10 +0000 (15:16 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 2 Feb 2026 14:16:23 +0000 (15:16 +0100)
Because of the missing 'goto', if the query was aborted, we
would leave behind the ask.* ini file.

src/shared/ask-password-api.c

index b8602eee788155fa0d6e663d8a0f1e1aa2640017..57536688005ba8bc50f04848a04d3ec26914acfa 100644 (file)
@@ -1004,8 +1004,10 @@ int ask_password_agent(
                         goto finish;
                 }
 
-                if (req->hup_fd >= 0 && pollfd[hup_fd_idx].revents & POLLHUP)
-                        return -ECONNRESET;
+                if (req->hup_fd >= 0 && pollfd[hup_fd_idx].revents & POLLHUP) {
+                        r = -ECONNRESET;
+                        goto finish;
+                }
 
                 if (inotify_fd >= 0 && pollfd[inotify_idx].revents != 0) {
                         (void) flush_fd(inotify_fd);