From: dtucker@openbsd.org Date: Thu, 29 May 2025 13:27:27 +0000 (+0000) Subject: upstream: When there's more than one x11 channel in use, return X-Git-Tag: V_10_1_P1~237 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc6c134b48ba4bcfadedcea17b4eddac329601d9;p=thirdparty%2Fopenssh-portable.git upstream: When there's more than one x11 channel in use, return lastused of most recently used x11 channel instead of the last one found. ok djm@ OpenBSD-Commit-ID: 94a72bf988d40a5bae2e38608f4e117f712569fe --- diff --git a/channels.c b/channels.c index cd27faab2..f71f82466 100644 --- a/channels.c +++ b/channels.c @@ -1,4 +1,4 @@ -/* $OpenBSD: channels.c,v 1.444 2025/05/24 11:41:51 djm Exp $ */ +/* $OpenBSD: channels.c,v 1.445 2025/05/29 13:27:27 dtucker Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -5353,7 +5353,8 @@ x11_channel_used_recently(struct ssh *ssh) { if (c == NULL || c->ctype == NULL || c->lastused == 0 || strcmp(c->ctype, "x11-connection") != 0) continue; - lastused = c->lastused; + if (c->lastused > lastused) + lastused = c->lastused; } return lastused != 0 && monotime() > lastused + 1; }