[openssh-commits] [openssh] 02/06: upstream: ssh-agent: fix socket cleanup for -a option (no pathspec)

git+noreply at mindrot.org git+noreply at mindrot.org
Thu Oct 1 08:50:59 AEST 2026


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit d4ed84e4cb15305d763a3acb16d8cf8693c65840
Author: djm at openbsd.org <djm at openbsd.org>
AuthorDate: Tue Sep 22 22:29:27 2026 +0000

    upstream: ssh-agent: fix socket cleanup for -a option (no pathspec)
    
    from markus@ ok me
    
    OpenBSD-Commit-ID: 3194c1ed609eaa05932b9f6036ace7561e140627
---
 misc-agent.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/misc-agent.c b/misc-agent.c
index 9a936938d..fc62dc601 100644
--- a/misc-agent.c
+++ b/misc-agent.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc-agent.c,v 1.10 2026/09/16 07:47:29 jsg Exp $ */
+/* $OpenBSD: misc-agent.c,v 1.11 2026/09/22 22:29:27 djm Exp $ */
 /*
  * Copyright (c) 2025 Damien Miller <djm at mindrot.org>
  *
@@ -321,7 +321,7 @@ int
 agent_listener_cleanup(const char *pathspec, const char *sockpath,
     const char *sockdir)
 {
-	if (sockpath == NULL || pathspec == NULL)
+	if (sockpath == NULL)
 		return 0;
 	if (unlink(sockpath) != 0) {
 		error_f("unlink \"%s\": %s", sockpath, strerror(errno));
@@ -329,6 +329,8 @@ agent_listener_cleanup(const char *pathspec, const char *sockpath,
 	}
 	debug3_f("removed socket %s", sockpath);
 
+	if (pathspec == NULL)
+		return 0;
 	if (strncmp(pathspec, "shared:", 7) == 0 && sockdir != NULL) {
 		if (rmdir(sockdir) != 0) {
 			error_f("rmdir \"%s\": %s", sockdir, strerror(errno));

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list