From nobody Sun Apr 21 13:28:11 2024 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VMq2N0H7Lz5JCmF; Sun, 21 Apr 2024 13:28:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VMq2M5Jrpz44qc; Sun, 21 Apr 2024 13:28:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713706091; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KNTPstzGCIFxcHK3nnPj0+4od753GSt8DULqiOhtJoQ=; b=tUlVfq7tUbmbQ+ueGI6CpBtGxi48jNYqtyyHKLa6LkPoJKDQ4gbPVKCuhyCBwMkAGmm70x dlKnSBukli5GT6Zg+0DWVE1oiOnW+KS3e1T2uUde08WVan6qacj9AGkR+e4yI24erJF6/t Fxz/r3y+EvLKX9u0W5gQ9GqcB9ypYnay8fgipUhwuykOFcgEvServX9lhIMk7WwyYXnYe9 8XWtSzn8CtdDzkBT8Jmndhwf75dypQHhg9vu/c8MVx+G/6DOzNrzVVLRcWTJw9n1f/Smr2 kioGuIlAL1mYUh6BxQZitXWGTr/YEXjxqAgd5ad5n7SdULoDwMLFl4XIUo5dfg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713706091; a=rsa-sha256; cv=none; b=C/28bvWeSTB8qxe1Rf8nc++gBfi+jO/WvEoB4GhuztfuNkb8v42OQ7AEOkBSVRUZHYZSKI 03jC4gSOKcmvbwqMvyjfBKwcKB/VWajtrHces30VwBY4P+neHkcWgKiYCZd8cc8yJLGrV4 cQ7tpAk8vcZFapOoXaA6MzG/8QoSVxtXUTsSxhTROsaR6pVhAIbIVthhQpY0OPGHVF+Kxr Emnt8K4AMPpIgjU9gUYrhIl4wYQxM8ow6maVrmBsmDOr04ySjQndyb0xg+WwnKC5GJ4FrZ S0d4g456DsPiUX3pam4y3pANwcFdvFkdgXvgNxf4G9pnaXlEK+/py9AHDTgXaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713706091; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KNTPstzGCIFxcHK3nnPj0+4od753GSt8DULqiOhtJoQ=; b=dHpuCipcKcCbYEHsAqZf91t9NUJ9fgtBh/i+92Jsnas69dvm0vdsPSJDzNHczwEk9jteJL OeDPZMMAPIAMC59UYPKZbTl+M+NdB1hFUlo1EDtbA7TxJxOj7jeQ0lT5Whx9u5ku2saybz 049a11VJfapA4rtE6hCeAoEsj5G66Sneryo2jNmhFOGYYsCDwx6rVVrbKNV4zuWzfKBvWa Ldj9JqaHtwcYQcQojYSIHUDZNaW/Y6jCJJT4QAfskMm4CzHRi3jv7sArStcqjabJH3fjd0 LzSlNs/dvgoIR39R51ObCBOdHY2Y9jWhHkfIHw5ii8IJdQwcu0pUfKkYGQxWfw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VMq2M4vKvz1M5X; Sun, 21 Apr 2024 13:28:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43LDSBrQ051801; Sun, 21 Apr 2024 13:28:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43LDSB97051798; Sun, 21 Apr 2024 13:28:11 GMT (envelope-from git) Date: Sun, 21 Apr 2024 13:28:11 GMT Message-Id: <202404211328.43LDSB97051798@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Guido Falsi Subject: git: 96b6500ac4d9 - main - x11/lightdm: Fix VT/user switching List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-all@freebsd.org Sender: owner-dev-commits-ports-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: madpilot X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 96b6500ac4d9de0d37c54823d4d0764890718f74 Auto-Submitted: auto-generated The branch main has been updated by madpilot: URL: https://cgit.FreeBSD.org/ports/commit/?id=96b6500ac4d9de0d37c54823d4d0764890718f74 commit 96b6500ac4d9de0d37c54823d4d0764890718f74 Author: Tijl Coosemans AuthorDate: 2024-04-21 13:27:18 +0000 Commit: Guido Falsi CommitDate: 2024-04-21 13:27:18 +0000 x11/lightdm: Fix VT/user switching Submitted upstream: https://github.com/canonical/lightdm/pull/353 PR: 278457 --- x11/lightdm/Makefile | 2 +- x11/lightdm/files/patch-src_vt.c | 99 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+), 1 deletion(-) diff --git a/x11/lightdm/Makefile b/x11/lightdm/Makefile index 3be758e97f2e..737751f9d759 100644 --- a/x11/lightdm/Makefile +++ b/x11/lightdm/Makefile @@ -1,6 +1,6 @@ PORTNAME= lightdm PORTVERSION= 1.32.0 -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES= x11 MASTER_SITES= https://github.com/canonical/${PORTNAME}/releases/download/${DISTVERSIONPREFIX}${DISTVERSION}/ diff --git a/x11/lightdm/files/patch-src_vt.c b/x11/lightdm/files/patch-src_vt.c new file mode 100644 index 000000000000..a41bfc74fd41 --- /dev/null +++ b/x11/lightdm/files/patch-src_vt.c @@ -0,0 +1,99 @@ +--- src/vt.c.orig 2019-08-04 22:29:55 UTC ++++ src/vt.c +@@ -16,6 +16,9 @@ + #include + #include + #include ++#ifdef __FreeBSD__ ++#include ++#endif + #ifdef __linux__ + #include + #endif +@@ -23,31 +26,56 @@ + #include "vt.h" + #include "configuration.h" + ++#if defined(__FreeBSD__) ++#define CONSOLE "/dev/console" ++#else ++#define CONSOLE "/dev/tty0" ++#endif ++ + static GList *used_vts = NULL; + + static gint + open_tty (void) + { +- int fd = g_open ("/dev/tty0", O_RDONLY | O_NOCTTY, 0); ++ int fd = g_open (CONSOLE, O_RDONLY | O_NOCTTY, 0); + if (fd < 0) +- g_warning ("Error opening /dev/tty0: %s", strerror (errno)); ++ g_warning ("Error opening " CONSOLE ": %s", strerror (errno)); + return fd; + } + + gboolean + vt_can_multi_seat (void) + { ++#if defined(__linux__) + /* Quick check to see if we can multi seat. This is intentionally the + same check logind does, just without actually reading from the files. + Existence will prove whether we have CONFIG_VT built into the kernel. */ + return access ("/dev/tty0", F_OK) == 0 && + access ("/sys/class/tty/tty0/active", F_OK) == 0; ++#else ++ return FALSE; ++#endif + } + + gint + vt_get_active (void) + { +-#ifdef __linux__ ++#if defined(__FreeBSD__) ++ int active, res; ++ int tty_fd = open_tty (); ++ ++ if (tty_fd >= 0) ++ { ++ res = ioctl (tty_fd, VT_GETACTIVE, &active); ++ close (tty_fd); ++ if (res == 0) ++ return active; ++ ++ g_warning ("Error using VT_GETACTIVE on " CONSOLE ": %s", strerror (errno)); ++ } ++ ++ return -1; ++#elif defined(__linux__) + /* Pretend always active */ + if (getuid () != 0) + return 1; +@@ -73,7 +101,7 @@ vt_set_active (gint number) + void + vt_set_active (gint number) + { +-#ifdef __linux__ ++#if defined(__FreeBSD__) || defined(__linux__) + g_debug ("Activating VT %d", number); + + /* Pretend always active */ +@@ -86,7 +114,7 @@ vt_set_active (gint number) + int n = number; + if (ioctl (tty_fd, VT_ACTIVATE, n) < 0) + { +- g_warning ("Error using VT_ACTIVATE %d on /dev/tty0: %s", n, strerror (errno)); ++ g_warning ("Error using VT_ACTIVATE %d on " CONSOLE ": %s", n, strerror (errno)); + close (tty_fd); + return; + } +@@ -101,7 +129,7 @@ vt_set_active (gint number) + { + if (errno == EINTR) + continue; +- g_warning ("Error using VT_WAITACTIVE %d on /dev/tty0: %s", n, strerror (errno)); ++ g_warning ("Error using VT_WAITACTIVE %d on " CONSOLE ": %s", n, strerror (errno)); + } + break; + }