mirror of
https://github.com/openssh/openssh-portable.git
synced 2026-11-06 05:16:43 +00:00
upstream: ssh-agent: fix socket cleanup for -a option (no pathspec)
from markus@ ok me OpenBSD-Commit-ID: 3194c1ed609eaa05932b9f6036ace7561e140627
This commit is contained in:
1 parent
1d5340fce2
commit
d4ed84e4cb
1 file changed
+4
-2
+4
-2
@@ -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@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));
|
||||
|
||||
Reference in new issue
Block a user