summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-04-11 23:58:49 +0200
committerLudovic Courtès <ludo@gnu.org>2020-04-11 23:58:49 +0200
commitf4ec5e1a9823a66c27fe2bc033db7b58b29edfef (patch)
tree16a18dd30b5cbdbdfb1ad8ffc0b67e3ef033bf5c
parent557e6820a77b24f8f3f03f28ee473137b1caeb64 (diff)
gnu: gdm: Don't offer GNOME when it's not in the system profile.
Fixes <https://bugs.gnu.org/37831>. Reported by Pierre Neidhardt <mail@ambrevar.xyz>. * gnu/packages/patches/gdm-default-session.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/gnome.scm (gdm)[source]: Use it.
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/gnome.scm3
-rw-r--r--gnu/packages/patches/gdm-default-session.patch91
3 files changed, 94 insertions, 1 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 73f9d5d69ce..0117a43ae2c 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -932,6 +932,7 @@ dist_patch_DATA = \
932 %D%/packages/patches/gd-CVE-2019-6978.patch \ 932 %D%/packages/patches/gd-CVE-2019-6978.patch \
933 %D%/packages/patches/gd-fix-tests-on-i686.patch \ 933 %D%/packages/patches/gd-fix-tests-on-i686.patch \
934 %D%/packages/patches/gd-freetype-test-failure.patch \ 934 %D%/packages/patches/gd-freetype-test-failure.patch \
935 %D%/packages/patches/gdm-default-session.patch \
935 %D%/packages/patches/geoclue-config.patch \ 936 %D%/packages/patches/geoclue-config.patch \
936 %D%/packages/patches/ghc-8.0-fall-back-to-madv_dontneed.patch \ 937 %D%/packages/patches/ghc-8.0-fall-back-to-madv_dontneed.patch \
937 %D%/packages/patches/ghc-diff-swap-cover-args.patch \ 938 %D%/packages/patches/ghc-diff-swap-cover-args.patch \
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 088de7dd4c4..63dd8dc4c60 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -6776,7 +6776,8 @@ libxml2.")
6776 name "-" version ".tar.xz")) 6776 name "-" version ".tar.xz"))
6777 (sha256 6777 (sha256
6778 (base32 6778 (base32
6779 "12ypdz9i24hwbl1d1wnnxb8zlvfa4f49n9ac5cl9d6h8qp4b0gb4")))) 6779 "12ypdz9i24hwbl1d1wnnxb8zlvfa4f49n9ac5cl9d6h8qp4b0gb4"))
6780 (patches (search-patches "gdm-default-session.patch"))))
6780 (build-system glib-or-gtk-build-system) 6781 (build-system glib-or-gtk-build-system)
6781 (arguments 6782 (arguments
6782 '(#:configure-flags 6783 '(#:configure-flags
diff --git a/gnu/packages/patches/gdm-default-session.patch b/gnu/packages/patches/gdm-default-session.patch
new file mode 100644
index 00000000000..4839a04de4a
--- /dev/null
+++ b/gnu/packages/patches/gdm-default-session.patch
@@ -0,0 +1,91 @@
1This patch ensures '.desktop' files are picked up in the system profile
2and not in the directories listed in $XDG_DATA_DIRS. The latter includes
3'gnome-session.desktop', which should be used if it's in
4/run/current-system/profile, and only then.
5
6Fixes <https://bugs.gnu.org/37831>.
7
8diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
9index 6a116a8..02c1458 100644
10--- a/daemon/gdm-session.c
11+++ b/daemon/gdm-session.c
12@@ -348,24 +348,18 @@ get_system_session_dirs (GdmSession *self)
13 GArray *search_array = NULL;
14 char **search_dirs;
15 int i;
16- const gchar * const *system_data_dirs = g_get_system_data_dirs ();
17
18 static const char *x_search_dirs[] = {
19 "/etc/X11/sessions/",
20 DMCONFDIR "/Sessions/",
21 DATADIR "/gdm/BuiltInSessions/",
22- DATADIR "/xsessions/",
23+ "/run/current-system/profile/share/xsessions/"
24 };
25
26 static const char *wayland_search_dir = DATADIR "/wayland-sessions/";
27
28 search_array = g_array_new (TRUE, TRUE, sizeof (char *));
29
30- for (i = 0; system_data_dirs[i]; i++) {
31- gchar *dir = g_build_filename (system_data_dirs[i], "xsessions", NULL);
32- g_array_append_val (search_array, dir);
33- }
34-
35 g_array_append_vals (search_array, x_search_dirs, G_N_ELEMENTS (x_search_dirs));
36
37 #ifdef ENABLE_WAYLAND_SUPPORT
38@@ -373,16 +367,7 @@ get_system_session_dirs (GdmSession *self)
39 #ifdef ENABLE_USER_DISPLAY_SERVER
40 g_array_prepend_val (search_array, wayland_search_dir);
41
42- for (i = 0; system_data_dirs[i]; i++) {
43- gchar *dir = g_build_filename (system_data_dirs[i], "wayland-sessions", NULL);
44- g_array_insert_val (search_array, i, dir);
45- }
46 #else
47- for (i = 0; system_data_dirs[i]; i++) {
48- gchar *dir = g_build_filename (system_data_dirs[i], "wayland-sessions", NULL);
49- g_array_append_val (search_array, dir);
50- }
51-
52 g_array_append_val (search_array, wayland_search_dir);
53 #endif
54 }
55diff --git a/libgdm/gdm-sessions.c b/libgdm/gdm-sessions.c
56index afbc5c0..bb5e3e6 100644
57--- a/libgdm/gdm-sessions.c
58+++ b/libgdm/gdm-sessions.c
59@@ -238,19 +238,11 @@ collect_sessions (void)
60 "/etc/X11/sessions/",
61 DMCONFDIR "/Sessions/",
62 DATADIR "/gdm/BuiltInSessions/",
63- DATADIR "/xsessions/",
64- NULL
65+ "/run/current-system/profile/share/xsessions/"
66 };
67
68 xorg_search_array = g_array_new (TRUE, TRUE, sizeof (char *));
69
70- const gchar * const *system_data_dirs = g_get_system_data_dirs ();
71-
72- for (i = 0; system_data_dirs[i]; i++) {
73- session_dir = g_build_filename (system_data_dirs[i], "xsessions", NULL);
74- g_array_append_val (xorg_search_array, session_dir);
75- }
76-
77 g_array_append_vals (xorg_search_array, xorg_search_dirs, G_N_ELEMENTS (xorg_search_dirs));
78
79 #ifdef ENABLE_WAYLAND_SUPPORT
80@@ -261,11 +253,6 @@ collect_sessions (void)
81
82 wayland_search_array = g_array_new (TRUE, TRUE, sizeof (char *));
83
84- for (i = 0; system_data_dirs[i]; i++) {
85- session_dir = g_build_filename (system_data_dirs[i], "wayland-sessions", NULL);
86- g_array_append_val (wayland_search_array, session_dir);
87- }
88-
89 g_array_append_vals (wayland_search_array, wayland_search_dirs, G_N_ELEMENTS (wayland_search_dirs));
90 #endif
91