guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: gnu: lightdm: Apply patch to fix VNC server addre


From: guix-commits
Subject: branch master updated: gnu: lightdm: Apply patch to fix VNC server address binding ordering.
Date: Sun, 09 Jul 2023 23:08:01 -0400

This is an automated email from the git hooks/post-receive script.

apteryx pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 65c77f6089 gnu: lightdm: Apply patch to fix VNC server address binding 
ordering.
65c77f6089 is described below

commit 65c77f608916f0c206d0d821db1afa2558c5a74f
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Sun Jul 9 22:30:15 2023 -0400

    gnu: lightdm: Apply patch to fix VNC server address binding ordering.
    
    * gnu/packages/patches/lightdm-vnc-ipv6.patch: New patch file.
    * gnu/local.mk (dist_patch_DATA): Register it.
    * gnu/packages/display-managers.scm (lightdm): Apply it.
    * gnu/tests/lightdm.scm (run-lightdm-test): Remove comment and expected fail
    directive for the "can connect to TCP port 5900 on IPv6" test.
    
    Suggested-by: Bruno Victal <mirai@makinata.eu>
---
 gnu/local.mk                                |  3 +-
 gnu/packages/display-managers.scm           |  5 +--
 gnu/packages/patches/lightdm-vnc-ipv6.patch | 48 +++++++++++++++++++++++++++++
 gnu/tests/lightdm.scm                       |  6 +---
 4 files changed, 54 insertions(+), 8 deletions(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 96f4594835..5aa79d6583 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1426,8 +1426,9 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/libvirt-add-install-prefix.patch        \
   %D%/packages/patches/libziparchive-add-includes.patch                \
   %D%/packages/patches/lightdm-arguments-ordering.patch                \
-  %D%/packages/patches/lightdm-vncserver-check.patch           \
+  %D%/packages/patches/lightdm-vnc-ipv6.patch                  \
   %D%/packages/patches/lightdm-vnc-color-depth.patch           \
+  %D%/packages/patches/lightdm-vncserver-check.patch           \
   %D%/packages/patches/localed-xorg-keyboard.patch             \
   %D%/packages/patches/kcontacts-incorrect-country-name.patch  \
   %D%/packages/patches/kde-cli-tools-delay-mime-db.patch       \
diff --git a/gnu/packages/display-managers.scm 
b/gnu/packages/display-managers.scm
index 9ddcef7021..f6c9283a29 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -12,7 +12,7 @@
 ;;; Copyright © 2021 Zheng Junjie <873216071@qq.com>
 ;;; Copyright © 2021, 2022 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
-;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -280,7 +280,8 @@ experience for your users, your family and yourself")
                 "1wr60c946p8jz9kb8zi4cd8d4mkcy7infbvlfzwajiglc22nblxn"))
               (patches (search-patches "lightdm-arguments-ordering.patch"
                                        "lightdm-vncserver-check.patch"
-                                       "lightdm-vnc-color-depth.patch"))))
+                                       "lightdm-vnc-color-depth.patch"
+                                       "lightdm-vnc-ipv6.patch"))))
     (build-system gnu-build-system)
     (arguments
      '(#:parallel-tests? #f             ; fails when run in parallel
diff --git a/gnu/packages/patches/lightdm-vnc-ipv6.patch 
b/gnu/packages/patches/lightdm-vnc-ipv6.patch
new file mode 100644
index 0000000000..68e4363d3e
--- /dev/null
+++ b/gnu/packages/patches/lightdm-vnc-ipv6.patch
@@ -0,0 +1,48 @@
+Submitted upstream: https://github.com/canonical/lightdm/pull/312
+
+diff --git a/src/vnc-server.c b/src/vnc-server.c
+index d3500764..00a2fc02 100644
+--- a/src/vnc-server.c
++++ b/src/vnc-server.c
+@@ -126,18 +126,10 @@ vnc_server_start (VNCServer *server)
+ 
+     g_return_val_if_fail (server != NULL, FALSE);
+ 
+-    g_autoptr(GError) ipv4_error = NULL;
+-    priv->socket = open_tcp_socket (G_SOCKET_FAMILY_IPV4, priv->port, 
priv->listen_address, &ipv4_error);
+-    if (ipv4_error)
+-        g_warning ("Failed to create IPv4 VNC socket: %s", 
ipv4_error->message);
+-
+-    if (priv->socket)
+-    {
+-        GSource *source = g_socket_create_source (priv->socket, G_IO_IN, 
NULL);
+-        g_source_set_callback (source, (GSourceFunc) read_cb, server, NULL);
+-        g_source_attach (source, NULL);
+-    }
+-
++    // Bind to IPv6 first, as this implies binding to 0.0.0.0 in the
++    // Linux kernel default configuration, which would otherwise cause
++    // IPv6 clients to fail with "Error binding to address [::]:5900:
++    // Address already in use" (#266).
+     g_autoptr(GError) ipv6_error = NULL;
+     priv->socket6 = open_tcp_socket (G_SOCKET_FAMILY_IPV6, priv->port, 
priv->listen_address, &ipv6_error);
+     if (ipv6_error)
+@@ -150,6 +142,18 @@ vnc_server_start (VNCServer *server)
+         g_source_attach (source, NULL);
+     }
+ 
++    g_autoptr(GError) ipv4_error = NULL;
++    priv->socket = open_tcp_socket (G_SOCKET_FAMILY_IPV4, priv->port, 
priv->listen_address, &ipv4_error);
++    if (ipv4_error)
++        g_warning ("Failed to create IPv4 VNC socket: %s", 
ipv4_error->message);
++
++    if (priv->socket)
++    {
++        GSource *source = g_socket_create_source (priv->socket, G_IO_IN, 
NULL);
++        g_source_set_callback (source, (GSourceFunc) read_cb, server, NULL);
++        g_source_attach (source, NULL);
++    }
++
+     if (!priv->socket && !priv->socket6)
+         return FALSE;
+ 
diff --git a/gnu/tests/lightdm.scm b/gnu/tests/lightdm.scm
index 6011d2c515..f1c3b67c8a 100644
--- a/gnu/tests/lightdm.scm
+++ b/gnu/tests/lightdm.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>.
+;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>.
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -142,10 +142,6 @@
             (test-assert "can connect to TCP port 5900 on IPv4"
               (wait-for-tcp-port 5900 marionette))
 
-            ;; The VNC server fails to listen to IPv6 due to "Error binding to
-            ;; address [::]:5900: Address already in use" (see:
-            ;; https://github.com/canonical/lightdm/issues/266).
-            (test-expect-fail 1)
             (test-assert "can connect to TCP port 5900 on IPv6"
               (wait-for-tcp-port 5900 marionette
                                  #:address



reply via email to

[Prev in Thread] Current Thread [Next in Thread]