diff --git a/SOURCES/housekeeping-disambiguate-mount-names-in-notifications.patch b/SOURCES/housekeeping-disambiguate-mount-names-in-notifications.patch new file mode 100644 index 0000000..a3dc06e --- /dev/null +++ b/SOURCES/housekeeping-disambiguate-mount-names-in-notifications.patch @@ -0,0 +1,71 @@ +From 0d6208bfaceaa9f27d30ff0f38e3accf7bd56f95 Mon Sep 17 00:00:00 2001 +From: Felipe Borges +Date: Wed, 15 Jan 2025 15:26:19 +0100 +Subject: [PATCH] housekeeping: Disambiguate mount point names in notifications + +There might be mount-points with same name, so when that's the case, +let's show the path instead. + +Related: RHEL-11910 +--- + plugins/housekeeping/gsd-disk-space.c | 18 +++++++++++++++--- + 1 file changed, 15 insertions(+), 3 deletions(-) + +diff --git a/plugins/housekeeping/gsd-disk-space.c b/plugins/housekeeping/gsd-disk-space.c +index c5ae8f6b..aff85205 100644 +--- a/plugins/housekeeping/gsd-disk-space.c ++++ b/plugins/housekeeping/gsd-disk-space.c +@@ -670,7 +670,8 @@ ldsm_notify (const char *summary, + + static void + ldsm_notify_for_mount (LdsmMountInfo *mount, +- gboolean multiple_volumes) ++ gboolean multiple_volumes, ++ gboolean is_ambiguous_name) + { + gboolean has_trash; + gchar *name; +@@ -688,7 +689,7 @@ ldsm_notify_for_mount (LdsmMountInfo *mount, + free_space_str = g_format_size (free_space); + + if (multiple_volumes) { +- summary = g_strdup_printf (_("Low Disk Space on “%s”"), name); ++ summary = g_strdup_printf (_("Low Disk Space on “%s”"), is_ambiguous_name ? path : name); + if (has_trash) { + body = g_strdup_printf (_("The volume “%s” has only %s disk space remaining. You may free up some space by emptying the trash."), + name, +@@ -778,8 +779,10 @@ ldsm_maybe_warn_mounts (GList *mounts, + gboolean multiple_volumes) + { + GList *l; ++ GHashTable *mount_names; + gboolean done = FALSE; + ++ mount_names = g_hash_table_new (g_str_hash, g_str_equal); + for (l = mounts; l != NULL; l = l->next) { + LdsmMountInfo *mount_info = l->data; + LdsmMountInfo *previous_mount_info; +@@ -832,10 +835,19 @@ ldsm_maybe_warn_mounts (GList *mounts, + } + + if (show_notify) { +- ldsm_notify_for_mount (mount_info, multiple_volumes); ++ g_autofree gchar *mount_name = NULL; ++ gboolean is_ambiguous_name = FALSE; ++ ++ mount_name = g_unix_mount_guess_name (mount_info->mount); ++ is_ambiguous_name = g_hash_table_contains (mount_names, mount_name); ++ g_hash_table_add (mount_names, mount_name); ++ ++ ldsm_notify_for_mount (mount_info, multiple_volumes, is_ambiguous_name); + done = TRUE; + } + } ++ ++ g_hash_table_destroy (mount_names); + } + + static gboolean +-- +2.37.1 + diff --git a/SOURCES/power-button-action-server.patch b/SOURCES/power-button-action-server.patch new file mode 100644 index 0000000..5d4e5aa --- /dev/null +++ b/SOURCES/power-button-action-server.patch @@ -0,0 +1,52 @@ +From 176f90307152e21e232a69c9ad06a31d30ba9c9a Mon Sep 17 00:00:00 2001 +From: Felipe Borges +Date: Mon, 20 Jan 2025 15:29:42 +0100 +Subject: [PATCH] Change the power-button-action behavior for Server with GUI + +When systemd-hostnamed chassis-type is "server" we read the +power-button-action-server side setting instead. + +Related: RHEL-71937 +--- + data/org.gnome.settings-daemon.plugins.power.gschema.xml.in | 5 +++++ + plugins/media-keys/gsd-media-keys-manager.c | 4 +++- + 2 files changed, 8 insertions(+), 1 deletion(-) + +diff --git a/data/org.gnome.settings-daemon.plugins.power.gschema.xml.in b/data/org.gnome.settings-daemon.plugins.power.gschema.xml.in +index e1a8787b..5a83666f 100644 +--- a/data/org.gnome.settings-daemon.plugins.power.gschema.xml.in ++++ b/data/org.gnome.settings-daemon.plugins.power.gschema.xml.in +@@ -41,6 +41,11 @@ + Power button action + The action to take when the system power button is pressed. Virtual machines only honor the 'nothing' action, and will shutdown otherwise. Tablets always suspend, ignoring all the other action options. + ++ ++ 'nothing' ++ Power button action on servers ++ The action to take when the system power button is pressed on "Server with GUI" environments. ++ + + true + Enable power-saver profile when battery is low +diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c +index 6ed8c323..631de0a3 100644 +--- a/plugins/media-keys/gsd-media-keys-manager.c ++++ b/plugins/media-keys/gsd-media-keys-manager.c +@@ -2266,11 +2266,13 @@ do_config_power_button_action (GsdMediaKeysManager *manager, + GsdMediaKeysManagerPrivate *priv = GSD_MEDIA_KEYS_MANAGER_GET_PRIVATE (manager); + GsdPowerButtonActionType action_type; + GsdPowerActionType action; ++ gboolean is_server = FALSE; + + if (priv->power_button_disabled) + return; + +- action_type = g_settings_get_enum (priv->power_settings, "power-button-action"); ++ is_server = g_strcmp0 (priv->chassis_type, "server") == 0; ++ action_type = g_settings_get_enum (priv->power_settings, is_server? "power-button-action-server" : "power-button-action"); + /* Always power off VMs, except when power-button-action is "nothing" */ + if (g_strcmp0 (priv->chassis_type, "vm") == 0) { + g_warning_once ("Virtual machines only honor the 'nothing' power-button-action, and will shutdown otherwise"); +-- +2.48.1 + diff --git a/SOURCES/smartcard-hotplug.patch b/SOURCES/smartcard-hotplug.patch new file mode 100644 index 0000000..1456942 --- /dev/null +++ b/SOURCES/smartcard-hotplug.patch @@ -0,0 +1,36 @@ +From e5b52d51d301bf19efc4211f2fa9f256f64a2a29 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?David=20H=C3=A4rdeman?= +Date: Wed, 12 Apr 2023 22:23:51 +0200 +Subject: [PATCH] smartcard: check for the addition of new smartcard readers + +gsd-smartcard currently checks for the insertion/removal of smartcards +in reader devices which where present at the time gsd-smartcard was +started, but does not account for new smartcard readers appearing +after gsd-smartcard was started. + +This patch adds support for checking for the addition of new slots +(i.e. smartcard readers), which is necessary to support devices +like the Yubikey (a "reader" and a smartcard) which may be inserted +after gsd-smartcard was started. +--- + plugins/smartcard/gsd-smartcard-manager.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/plugins/smartcard/gsd-smartcard-manager.c b/plugins/smartcard/gsd-smartcard-manager.c +index acd22df819..a219e22ef7 100644 +--- a/plugins/smartcard/gsd-smartcard-manager.c ++++ b/plugins/smartcard/gsd-smartcard-manager.c +@@ -212,7 +212,12 @@ watch_one_event_from_driver (GsdSmartcardManager *self, + error_code = PORT_GetError (); + + if (error_code == SEC_ERROR_NO_EVENT) { +- g_usleep (1 * G_USEC_PER_SEC); ++ int old_slot_count = operation->driver->slotCount; ++ SECMOD_UpdateSlotList (operation->driver); ++ if (operation->driver->slotCount != old_slot_count) ++ g_debug ("Slot count change %i -> %i", old_slot_count, operation->driver->slotCount); ++ else ++ g_usleep (1 * G_USEC_PER_SEC); + + return TRUE; + } diff --git a/SOURCES/subman-build-option.patch b/SOURCES/subman-build-option.patch new file mode 100644 index 0000000..65f4ddf --- /dev/null +++ b/SOURCES/subman-build-option.patch @@ -0,0 +1,65 @@ +From dfa3c4a2a12272b110fac942f96935846ef055e8 Mon Sep 17 00:00:00 2001 +From: Felipe Borges +Date: Tue, 28 Jan 2025 15:52:21 +0100 +Subject: [PATCH] build: Add "subman" conditional build option + +Related: RHEL-4092 +--- + meson.build | 7 ++++++- + meson_options.txt | 2 ++ + plugins/meson.build | 4 ++++ + 3 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/meson.build b/meson.build +index 644ba060..ee3bfe85 100644 +--- a/meson.build ++++ b/meson.build +@@ -104,7 +104,6 @@ libcanberra_gtk_dep = dependency('libcanberra-gtk3') + libgeoclue_dep = dependency('libgeoclue-2.0', version: '>= 2.3.1') + libnotify_dep = dependency('libnotify', version: '>= 0.7.3') + libpulse_mainloop_glib_dep = dependency('libpulse-mainloop-glib', version: '>= 2.0') +-jsonglib_dep = dependency('json-glib-1.0', version: '>= 1.1.1') + pango_dep = dependency('pango', version: '>= 1.20.0') + polkit_gobject_dep = dependency('polkit-gobject-1', version: '>= 0.114') + upower_glib_dep = dependency('upower-glib', version: '>= 0.99.8') +@@ -232,6 +231,12 @@ if enable_colord + colord_dep = dependency('colord', version: '>= 1.4.5') + endif + ++# subman ++enable_subman = get_option('subman') ++if enable_subman ++ jsonglib_dep = dependency('json-glib-1.0', version: '>= 1.1.1') ++endif ++ + gnome = import('gnome') + i18n = import('i18n') + pkg = import('pkgconfig') +diff --git a/meson_options.txt b/meson_options.txt +index 3e04cf64..7e6e3d58 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -12,3 +12,5 @@ option('usb-protection', type: 'boolean', value: true, description: 'build with + option('wayland', type: 'boolean', value: true, description: 'build with Wayland support') + option('wwan', type: 'boolean', value: true, description: 'build with WWAN support') + option('colord', type: 'boolean', value: true, description: 'build with colord support') ++ ++option('subman', type: 'boolean', value: true, description: 'build with Red Hat subscription manager support') +diff --git a/plugins/meson.build b/plugins/meson.build +index 59266c8d..22cdc847 100644 +--- a/plugins/meson.build ++++ b/plugins/meson.build +@@ -53,6 +53,10 @@ if not enable_cups + disabled_plugins += ['print-notifications'] + endif + ++if not enable_subman ++ disabled_plugins += ['subman'] ++endif ++ + # Specify futher required units, 'before' or 'after' may be specified if ordering is needed + plugin_gate_units = { + 'xsettings': [ +-- +2.34.1 + diff --git a/SOURCES/subman-launch-registration-dialog-directly.patch b/SOURCES/subman-launch-registration-dialog-directly.patch new file mode 100644 index 0000000..4510043 --- /dev/null +++ b/SOURCES/subman-launch-registration-dialog-directly.patch @@ -0,0 +1,31 @@ +From ae039526040319438367802194dc4f7ad5789855 Mon Sep 17 00:00:00 2001 +From: Felipe Borges +Date: Thu, 30 Jan 2025 17:50:40 +0100 +Subject: [PATCH] Launch subscription registration dialog directly from + notification + +In https://issues.redhat.com/browse/RHEL-4101, GNOME Settings will start +handling `gnome-control-center info-overview subman-register` to launch +the dialog directly. +--- + plugins/subman/gsd-subscription-manager.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/plugins/subman/gsd-subscription-manager.c b/plugins/subman/gsd-subscription-manager.c +index 09a96a3a..e3b0565d 100644 +--- a/plugins/subman/gsd-subscription-manager.c ++++ b/plugins/subman/gsd-subscription-manager.c +@@ -1082,8 +1082,8 @@ gsd_subscription_manager_class_init (GsdSubscriptionManagerClass *klass) + static void + _launch_info_overview (void) + { +- const gchar *argv[] = { "gnome-control-center", "info-overview", NULL }; +- g_debug ("Running gnome-control-center info-overview"); ++ const gchar *argv[] = { "gnome-control-center", "info-overview", "subman-register", NULL }; ++ g_debug ("Running gnome-control-center info-overview subman-register"); + g_spawn_async (NULL, (gchar **) argv, NULL, G_SPAWN_SEARCH_PATH, + NULL, NULL, NULL, NULL); + } +-- +2.48.1 + diff --git a/SOURCES/usb-protection-dont-crash-when-screensaver-service-unavailable.patch b/SOURCES/usb-protection-dont-crash-when-screensaver-service-unavailable.patch new file mode 100644 index 0000000..2547719 --- /dev/null +++ b/SOURCES/usb-protection-dont-crash-when-screensaver-service-unavailable.patch @@ -0,0 +1,34 @@ +From 466f84d2483c1187a9e5503eebbd18cdf9c15b14 Mon Sep 17 00:00:00 2001 +From: Michael Catanzaro +Date: Fri, 17 Sep 2021 07:39:24 -0500 +Subject: [PATCH] usb-protection: don't crash when screensaver service is + unavailable + +gnome_settings_bus_get_screen_saver_proxy() can return NULL, e.g. when +D-Bus is broken. We need to handle that case. + +Fixes #585 +--- + plugins/usb-protection/gsd-usb-protection-manager.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/plugins/usb-protection/gsd-usb-protection-manager.c b/plugins/usb-protection/gsd-usb-protection-manager.c +index 63a4e0d7..d8705316 100644 +--- a/plugins/usb-protection/gsd-usb-protection-manager.c ++++ b/plugins/usb-protection/gsd-usb-protection-manager.c +@@ -951,6 +951,12 @@ usb_protection_proxy_ready (GObject *source_object, + G_CALLBACK (settings_changed_callback), manager); + + manager->screensaver_proxy = gnome_settings_bus_get_screen_saver_proxy (); ++ if (!manager->screensaver_proxy) { ++ if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) ++ g_warning ("Failed to connect to screensaver service: %s", error->message); ++ g_clear_object (&manager->usb_protection); ++ return; ++ } + + get_current_screen_saver_status (manager); + +-- +2.37.1 + diff --git a/SPECS/gnome-settings-daemon.spec b/SPECS/gnome-settings-daemon.spec index b50f21c..9033846 100644 --- a/SPECS/gnome-settings-daemon.spec +++ b/SPECS/gnome-settings-daemon.spec @@ -11,7 +11,7 @@ Name: gnome-settings-daemon Version: 40.0.1 -Release: 16%{?dist} +Release: 22%{?dist} Summary: The daemon sharing settings from GNOME to GTK+/KDE applications License: GPLv2+ @@ -72,6 +72,18 @@ Patch00002: subscription-manager-support.patch Patch00003: im-module-setting-fix.patch Patch00004: print-notifications-clear-in-stop.patch Patch00005: 0001-power-Respect-the-nothing-power-button-action-for-VM.patch +Patch00006: usb-protection-dont-crash-when-screensaver-service-unavailable.patch +Patch00007: smartcard-hotplug.patch +Patch00008: power-button-action-server.patch + +# https://issues.redhat.com/browse/RHEL-4101 +Patch00009: subman-launch-registration-dialog-directly.patch + +# https://issues.redhat.com/browse/RHEL-4092 +Patch00010: subman-build-option.patch + +# https://issues.redhat.com/browse/RHEL-11910 +Patch00011: housekeeping-disambiguate-mount-names-in-notifications.patch %description A daemon to share settings from GNOME to other applications. It also @@ -197,6 +209,30 @@ cp %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/glib-2.0/schemas %{_libdir}/pkgconfig/gnome-settings-daemon.pc %changelog +* Tue Mar 04 2025 Felipe Borges - 40.0.1-22 +- Use mount path in "Low disk" notification when multiple mount points have same name + Related: RHEL-11910 + +* Thu Feb 27 2025 Felipe Borges - 40.0.1-21 +- Add build option to disable subman plugin + Related: RHEL-4092 + +* Thu Jan 30 2025 Felipe Borges - 40.0.1-20 +- Make "Register System" notification launch registration dialog directly + Related: RHEL-4101 + +* Mon Jan 20 2025 Felipe Borges - 40.0.1-19 +- Fix default power-button-action setting for servers + Related: RHEL-71937 + +* Tue Oct 29 2024 Felipe Borges - 40.0.1-18 +- Fix smartcards only working when cold-plugged + Related: RHEL-47261 + +* Mon Mar 25 2024 Felipe Borges - 40.0.1-17 +- Fix usb-protection crash when when screensaver service is unavailable + Related: RHEL-19295 + * Thu Jan 18 2024 Ray Strode - 40.0.1-16 - Try to start rhsm if it's not already running Related: RHEL-20449