]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: When there's more than one x11 channel in use, return
authordtucker@openbsd.org <dtucker@openbsd.org>
Thu, 29 May 2025 13:27:27 +0000 (13:27 +0000)
committerDarren Tucker <dtucker@dtucker.net>
Mon, 2 Jun 2025 14:10:23 +0000 (00:10 +1000)
lastused of most recently used x11 channel instead of the last one found. ok
djm@

OpenBSD-Commit-ID: 94a72bf988d40a5bae2e38608f4e117f712569fe

channels.c

index cd27faab2cf3c53ea15abd28dd836a9c0d800323..f71f82466f2f6dd0e995e9aa7ac7736bb9cc7829 100644 (file)
@@ -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 <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, 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;
 }