From patchwork Sat Aug 13 06:54:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 41599 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id BBB5127BBE9; Sat, 13 Aug 2022 07:57:00 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 04E7727BBEA for ; Sat, 13 Aug 2022 07:57:00 +0100 (BST) Received: from localhost ([::1]:44528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oMl4t-0005zG-1g for patchwork@mira.cbaines.net; Sat, 13 Aug 2022 02:56:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45602) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oMl3z-0004lA-Mu for guix-patches@gnu.org; Sat, 13 Aug 2022 02:56:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41551) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oMl3z-0006X3-Cp for guix-patches@gnu.org; Sat, 13 Aug 2022 02:56:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oMl3z-0006rm-9A for guix-patches@gnu.org; Sat, 13 Aug 2022 02:56:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57168] [PATCH 09/14] gnu: lightdm: Apply patch to fix a problem with VNC integration. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 13 Aug 2022 06:56:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57168 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57168@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 57168-submit@debbugs.gnu.org id=B57168.166037370526271 (code B ref 57168); Sat, 13 Aug 2022 06:56:03 +0000 Received: (at 57168) by debbugs.gnu.org; 13 Aug 2022 06:55:05 +0000 Received: from localhost ([127.0.0.1]:59519 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oMl32-0006pY-M6 for submit@debbugs.gnu.org; Sat, 13 Aug 2022 02:55:05 -0400 Received: from mail-qv1-f48.google.com ([209.85.219.48]:34742) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oMl2r-0006mQ-7h for 57168@debbugs.gnu.org; Sat, 13 Aug 2022 02:54:54 -0400 Received: by mail-qv1-f48.google.com with SMTP id u8so2112095qvv.1 for <57168@debbugs.gnu.org>; Fri, 12 Aug 2022 23:54:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=hbNsSepCui1ieEk+lBI2a/+3WrLTiGxHmvFEkJJ0TpA=; b=OAvUZTbqSInzilItegBuz3Aw/nCXD8QR4FY19PGNL083QCD9jxciGcndkPpLrIl4ZF 4+oOVALDBU9oXWI+q9inf+tT5pdEcRkOCYGOScsdWfb9b7F+BWHM52oVid1lkbaUJHYu LW3WajFZTfV+RwwRpi8HKEuUYoGcwaY7THXxFN0Z9cHxJs8NEbqT2z5hWUdSg9LHcgLv Tc4KEKwQlZ4NzASoRCK4qmWsa9alkU4kDQTTyZQsMFMeyGoKQGuL9KdCdeKEMN0jI8FO Lh9cmqEcNjDtdfaJGotuyStvDilK1rODt+ps4QjXqKILeUMV2fUoK0D2u1Zyn48Ub9fG J8CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=hbNsSepCui1ieEk+lBI2a/+3WrLTiGxHmvFEkJJ0TpA=; b=EZlJohQWor8J8yC5ayHWVnyKQS9Ywr35dWubkOoB3v3ILgEi0WxDee1jC46jIhkYWm dw6a31OKr1HyR6xIbqm2LB/BsDcQNB7X4VyVd+5W8Pug0u125bNDSXu0jke+2ta4GpTE 9Srhmp/Md62a2yh6+tKoo5u7AzKn8t3XJbOgdgMJgGwESLiYo9O4v6Gto+uN29b8cZKS dMCpaxNOhJyZMNlSJf4WDy1hj/pN3WjhTR7QnwaGMBqodeuJ79iZs82ncU4cHukRvSnM uKRqScVi+3diD840lbiScde4a9ZWSOWX95/w9KVvn/CWOxE2UN3da5asW8tNJxbJLDmA OCIQ== X-Gm-Message-State: ACgBeo2OR27nF9kKu3mHMrWFsOQ5o8rBT1rlpUmDJNDQEqinzdT4r9ei zB65Ri+utjKZPiqZ24QYo3jbbLyvtsg= X-Google-Smtp-Source: AA6agR5k2dqHTpHyu2ndpMseRcpRLr9lHPH+PI4YFs9M8fHrqYzyrVTZywtLRhT4PBAch5rIH7R43g== X-Received: by 2002:a05:6214:2aac:b0:474:8b64:8f56 with SMTP id js12-20020a0562142aac00b004748b648f56mr6339399qvb.0.1660373687437; Fri, 12 Aug 2022 23:54:47 -0700 (PDT) Received: from localhost.localdomain (dsl-205-233-125-72.b2b2c.ca. [205.233.125.72]) by smtp.gmail.com with ESMTPSA id s12-20020a05620a29cc00b006b6757a11fcsm3734441qkp.36.2022.08.12.23.54.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Aug 2022 23:54:46 -0700 (PDT) From: Maxim Cournoyer Date: Sat, 13 Aug 2022 02:54:28 -0400 Message-Id: <20220813065433.27319-9-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220813065433.27319-1-maxim.cournoyer@gmail.com> References: <20220813065433.27319-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/patches/lightdm-vncserver-check.patch: New patch. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/display-managers.scm (lightdm): Apply it. --- gnu/local.mk | 1 + gnu/packages/display-managers.scm | 7 +- .../patches/lightdm-vncserver-check.patch | 66 +++++++++++++++++++ 3 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 gnu/packages/patches/lightdm-vncserver-check.patch diff --git a/gnu/local.mk b/gnu/local.mk index c2a33fa7d1..b1b0f7ac36 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1355,6 +1355,7 @@ dist_patch_DATA = \ %D%/packages/patches/librime-fix-build-with-gcc10.patch \ %D%/packages/patches/libvirt-add-install-prefix.patch \ %D%/packages/patches/libziparchive-add-includes.patch \ + %D%/packages/patches/lightdm-vncserver-check.patch \ %D%/packages/patches/localed-xorg-keyboard.patch \ %D%/packages/patches/kdiagram-Fix-missing-link-libraries.patch \ %D%/packages/patches/kiki-level-selection-crash.patch \ diff --git a/gnu/packages/display-managers.scm b/gnu/packages/display-managers.scm index d6cf9445c6..022e0509aa 100644 --- a/gnu/packages/display-managers.scm +++ b/gnu/packages/display-managers.scm @@ -268,7 +268,8 @@ (define-public lightdm (file-name (git-file-name name version)) (sha256 (base32 - "1wr60c946p8jz9kb8zi4cd8d4mkcy7infbvlfzwajiglc22nblxn")))) + "1wr60c946p8jz9kb8zi4cd8d4mkcy7infbvlfzwajiglc22nblxn")) + (patches (search-patches "lightdm-vncserver-check.patch")))) (build-system gnu-build-system) (arguments '(#:parallel-tests? #f ; fails when run in parallel @@ -303,8 +304,8 @@ (define-public lightdm (unsetenv "LC_ALL")))))) (inputs (list audit - bash-minimal ;for cross-compilation - coreutils-minimal ;ditto + bash-minimal ;for cross-compilation + coreutils-minimal ;ditto linux-pam shadow ;for sbin/nologin libgcrypt diff --git a/gnu/packages/patches/lightdm-vncserver-check.patch b/gnu/packages/patches/lightdm-vncserver-check.patch new file mode 100644 index 0000000000..0e31ff3d68 --- /dev/null +++ b/gnu/packages/patches/lightdm-vncserver-check.patch @@ -0,0 +1,66 @@ +Honor the Xvnc command specified in the config instead of using a hard-coded +default. + +Submitted upstream at: https://github.com/canonical/lightdm/pull/265 + +diff --git a/src/lightdm.c b/src/lightdm.c +index 74f9ff2d..0ccfcd78 100644 +--- a/src/lightdm.c ++++ b/src/lightdm.c +@@ -349,27 +349,42 @@ start_display_manager (void) + /* Start the VNC server */ + if (config_get_boolean (config_get_instance (), "VNCServer", "enabled")) + { +- g_autofree gchar *path = g_find_program_in_path ("Xvnc"); +- if (path) ++ /* Validate that a the VNC command is available. */ ++ g_autofree gchar *command = config_get_string (config_get_instance (), "VNCServer", "command"); ++ if (command) + { +- vnc_server = vnc_server_new (); +- if (config_has_key (config_get_instance (), "VNCServer", "port")) ++ g_auto(GStrv) tokens = g_strsplit (command, " ", 2); ++ if (!g_find_program_in_path (tokens[0])) + { +- gint port = config_get_integer (config_get_instance (), "VNCServer", "port"); +- if (port > 0) +- vnc_server_set_port (vnc_server, port); ++ g_warning ("Can't start VNC server; command '%s' not found", tokens[0]); ++ return; + } +- g_autofree gchar *listen_address = config_get_string (config_get_instance (), "VNCServer", "listen-address"); +- vnc_server_set_listen_address (vnc_server, listen_address); +- g_signal_connect (vnc_server, VNC_SERVER_SIGNAL_NEW_CONNECTION, G_CALLBACK (vnc_connection_cb), NULL); +- +- g_debug ("Starting VNC server on TCP/IP port %d", vnc_server_get_port (vnc_server)); +- vnc_server_start (vnc_server); + } + else +- g_warning ("Can't start VNC server, Xvnc is not in the path"); ++ { ++ /* Fallback to 'Xvnc'. */ ++ if (!g_find_program_in_path ("Xvnc")) { ++ g_warning ("Can't start VNC server; 'Xvnc' command not found"); ++ return; ++ } ++ } ++ ++ vnc_server = vnc_server_new (); ++ if (config_has_key (config_get_instance (), "VNCServer", "port")) ++ { ++ gint port = config_get_integer (config_get_instance (), "VNCServer", "port"); ++ if (port > 0) ++ vnc_server_set_port (vnc_server, port); ++ } ++ g_autofree gchar *listen_address = config_get_string (config_get_instance (), "VNCServer", "listen-address"); ++ vnc_server_set_listen_address (vnc_server, listen_address); ++ g_signal_connect (vnc_server, VNC_SERVER_SIGNAL_NEW_CONNECTION, G_CALLBACK (vnc_connection_cb), NULL); ++ ++ g_debug ("Starting VNC server on TCP/IP port %d", vnc_server_get_port (vnc_server)); ++ vnc_server_start (vnc_server); + } + } ++ + static void + service_ready_cb (DisplayManagerService *service) + {