From dc6c134b48ba4bcfadedcea17b4eddac329601d9 Mon Sep 17 00:00:00 2001 From: "dtucker@openbsd.org" Date: Thu, 29 May 2025 13:27:27 +0000 Subject: [PATCH] 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 --- channels.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; } -- 2.47.2