Fix crash on missing systemd files

Resolves: https://issues.redhat.com/browse/RHEL-84829
This commit is contained in:
Olivier Fourdan 2025-03-19 14:45:02 +01:00
parent 807120a20d
commit 0ad9da5a97
2 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,42 @@
From 269cf451feb18206f9a8326d8fa36bc36f9b1897 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Wed, 19 Mar 2025 14:41:15 +0100
Subject: [PATCH] input-sources-manager: Do not crash if there is no X11Layouts
When queried for the X11Layout property, localed will try to get the
configuration from /etc/X11/xorg.conf.d/00-keyboard.conf.
If for some reason (the system was misconfigured or the installation was
altered), that directory is not accessible or not present, localed will
return a NULL string instead of the actual X11 layouts or even an empty
string if no X11 layout was ever configured.
In such a case, gnome-kiosk will segfault.
To avoid that potential problem, check for the X11 layouts to be not
NULL or return early if that's not the case.
Fixes: 38407233 - input-sources-manager: Add APIs for setting keymap
Part-of: <https://gitlab.gnome.org/GNOME/gnome-kiosk/-/merge_requests/68>
---
compositor/kiosk-input-sources-manager.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/compositor/kiosk-input-sources-manager.c b/compositor/kiosk-input-sources-manager.c
index 31dab12..6200af5 100644
--- a/compositor/kiosk-input-sources-manager.c
+++ b/compositor/kiosk-input-sources-manager.c
@@ -869,6 +869,10 @@ kiosk_input_sources_manager_set_input_sources_from_system_configuration (KioskIn
g_debug ("KioskInputSourcesManager: Setting keymap from system configuration");
layouts_string = sd_locale1_get_x11_layout (self->locale_proxy);
+ if (layouts_string == NULL) {
+ g_debug ("KioskInputSourcesManager: No layouts defined");
+ return FALSE;
+ }
g_debug ("KioskInputSourcesManager: System layout is '%s'", layouts_string);
layouts = g_strsplit (layouts_string, ",", -1);
--
2.49.0

View File

@ -53,6 +53,8 @@ Patch: 0001-search-app-Add-systemd-session-files.patch
Patch: 0002-search-app-Update-desktop-file-definition.patch
# https://issues.redhat.com/browse/RHEL-36521
Patch: 0001-search-app-Use-firefox-from-flatpak.patch
# https://issues.redhat.com/browse/RHEL-84829
Patch: 0001-input-sources-manager-Do-not-crash-if-there-is-no-X1.patch
%description
GNOME Kiosk provides a desktop enviroment suitable for fixed purpose, or