Skip to content

Commit fc86875

Browse files
committed
upstream: Fix logic error in DisableForwarding option. This option
was documented as disabling X11 and agent forwarding but it failed to do so. Spotted by Tim Rice. OpenBSD-Commit-ID: fffc89195968f7eedd2fc57f0b1f1ef3193f5ed1
1 parent dd73459 commit fc86875

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

session.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: session.c,v 1.340 2024/12/06 06:55:28 dtucker Exp $ */
1+
/* $OpenBSD: session.c,v 1.341 2025/04/09 07:00:03 djm Exp $ */
22
/*
33
* Copyright (c) 1995 Tatu Ylonen <[email protected]>, Espoo, Finland
44
* All rights reserved
@@ -2171,7 +2171,8 @@ session_auth_agent_req(struct ssh *ssh, Session *s)
21712171
if ((r = sshpkt_get_end(ssh)) != 0)
21722172
sshpkt_fatal(ssh, r, "%s: parse packet", __func__);
21732173
if (!auth_opts->permit_agent_forwarding_flag ||
2174-
!options.allow_agent_forwarding) {
2174+
!options.allow_agent_forwarding ||
2175+
options.disable_forwarding) {
21752176
debug_f("agent forwarding disabled");
21762177
return 0;
21772178
}
@@ -2566,7 +2567,7 @@ session_setup_x11fwd(struct ssh *ssh, Session *s)
25662567
ssh_packet_send_debug(ssh, "X11 forwarding disabled by key options.");
25672568
return 0;
25682569
}
2569-
if (!options.x11_forwarding) {
2570+
if (!options.x11_forwarding || options.disable_forwarding) {
25702571
debug("X11 forwarding disabled in server configuration file.");
25712572
return 0;
25722573
}

0 commit comments

Comments
 (0)