summaryrefslogtreecommitdiff
path: root/security/openssh-portable/files/patch-ssh-agent.c
diff options
context:
space:
mode:
authorBryan Drewery <bdrewery@FreeBSD.org>2022-03-03 10:27:34 -0800
committerBryan Drewery <bdrewery@FreeBSD.org>2022-03-03 11:25:36 -0800
commitae66cffc19f357cbd51d5841c9b110a9ffd63e32 (patch)
treecded17535bdb581e86bfec6d6ce5c6093cbb6a17 /security/openssh-portable/files/patch-ssh-agent.c
parentsecurity/openssh-portable: Fix subtle rc script problem. (diff)
security/openssh-portable: Update to 8.9p1
- Unbreak GSSAPI [1] - rc.d/openssh: Allow modifying host key generation [2] Changes: https://www.openssh.com/txt/release-8.9 PR: 259909 [1] PR: 202169 [2] Submitted by: Rick Miller [1] Submitted by: Chad Jacob Milios [2]
Diffstat (limited to 'security/openssh-portable/files/patch-ssh-agent.c')
-rw-r--r--security/openssh-portable/files/patch-ssh-agent.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/security/openssh-portable/files/patch-ssh-agent.c b/security/openssh-portable/files/patch-ssh-agent.c
index de53881aa541..2937b4a7d2f9 100644
--- a/security/openssh-portable/files/patch-ssh-agent.c
+++ b/security/openssh-portable/files/patch-ssh-agent.c
@@ -8,9 +8,9 @@ r226103 | des | 2011-10-07 08:10:16 -0500 (Fri, 07 Oct 2011) | 5 lines
Add a -x option that causes ssh-agent(1) to exit when all clients have
disconnected.
---- ssh-agent.c.orig 2021-04-15 20:55:25.000000000 -0700
-+++ ssh-agent.c 2021-04-27 11:47:59.362589000 -0700
-@@ -171,9 +171,26 @@ static int fingerprint_hash = SSH_FP_HASH_DEFAULT;
+--- ssh-agent.c.orig 2022-02-23 03:31:11.000000000 -0800
++++ ssh-agent.c 2022-03-02 12:50:47.745853000 -0800
+@@ -189,11 +189,28 @@ static int fingerprint_hash = SSH_FP_HASH_DEFAULT;
/* Refuse signing of non-SSH messages for web-origin FIDO keys */
static int restrict_websafe = 1;
@@ -27,17 +27,19 @@ disconnected.
static void
close_socket(SocketEntry *e)
{
+ size_t i;
+ int last = 0;
-+
+
+ if (e->type == AUTH_CONNECTION) {
+ debug("xcount %d -> %d", xcount, xcount - 1);
+ if (--xcount == 0)
+ last = 1;
+ }
++
close(e->fd);
sshbuf_free(e->input);
sshbuf_free(e->output);
-@@ -181,6 +198,8 @@ close_socket(SocketEntry *e)
+@@ -206,6 +223,8 @@ close_socket(SocketEntry *e)
memset(e, '\0', sizeof(*e));
e->fd = -1;
e->type = AUTH_UNUSED;
@@ -46,7 +48,7 @@ disconnected.
}
static void
-@@ -1067,6 +1086,10 @@ new_socket(sock_type type, int fd)
+@@ -1707,6 +1726,10 @@ new_socket(sock_type type, int fd)
debug_f("type = %s", type == AUTH_CONNECTION ? "CONNECTION" :
(type == AUTH_SOCKET ? "SOCKET" : "UNKNOWN"));
@@ -57,7 +59,7 @@ disconnected.
set_nonblock(fd);
if (fd > max_fd)
-@@ -1360,7 +1383,7 @@ static void
+@@ -1999,7 +2022,7 @@ static void
usage(void)
{
fprintf(stderr,
@@ -66,7 +68,7 @@ disconnected.
" [-P allowed_providers] [-t life]\n"
" ssh-agent [-a bind_address] [-E fingerprint_hash] [-P allowed_providers]\n"
" [-t life] command [arg ...]\n"
-@@ -1394,6 +1417,7 @@ main(int ac, char **av)
+@@ -2033,6 +2056,7 @@ main(int ac, char **av)
/* drop */
setegid(getgid());
setgid(getgid());
@@ -74,7 +76,7 @@ disconnected.
platform_disable_tracing(0); /* strict=no */
-@@ -1405,7 +1429,7 @@ main(int ac, char **av)
+@@ -2044,7 +2068,7 @@ main(int ac, char **av)
__progname = ssh_get_progname(av[0]);
seed_rng();
@@ -83,7 +85,7 @@ disconnected.
switch (ch) {
case 'E':
fingerprint_hash = ssh_digest_alg_by_name(optarg);
-@@ -1454,6 +1478,9 @@ main(int ac, char **av)
+@@ -2093,6 +2117,9 @@ main(int ac, char **av)
fprintf(stderr, "Invalid lifetime\n");
usage();
}