diff --git a/gnome-control-center-42.0-fix-sharing-panel-crash.patch b/gnome-control-center-42.0-fix-sharing-panel-crash.patch new file mode 100644 index 0000000..656e58a --- /dev/null +++ b/gnome-control-center-42.0-fix-sharing-panel-crash.patch @@ -0,0 +1,48 @@ +From c2f088ac5220f3a64edc2c15e60fc0d7f1dfc9e5 Mon Sep 17 00:00:00 2001 +From: Hu Jialun +Date: Mon, 28 Mar 2022 14:35:21 +0800 +Subject: [PATCH] sharing/remote-desktop: Fallback when getlogin() fails + +getlogin() can fail for several reasons as detailed in the man page, and +the current behaviour is a segmentation fault when it fails and returns +NULL. + +Make it fallback to getpwuid(getuid())->pw_name when that happens to +prevent crashing. +--- + panels/sharing/cc-sharing-panel.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/panels/sharing/cc-sharing-panel.c b/panels/sharing/cc-sharing-panel.c +index d126a2236..e65ebf92d 100644 +--- a/panels/sharing/cc-sharing-panel.c ++++ b/panels/sharing/cc-sharing-panel.c +@@ -45,6 +45,9 @@ + + #include + ++#include ++#include ++ + static void cc_sharing_panel_setup_label_with_hostname (CcSharingPanel *self, GtkWidget *label); + static GtkWidget *cc_sharing_panel_new_media_sharing_row (const char *uri_or_path, + CcSharingPanel *self); +@@ -1372,9 +1375,13 @@ cc_sharing_panel_setup_remote_desktop_dialog (CcSharingPanel *self) + G_CALLBACK (remote_desktop_credentials_changed), + self); + +- if (username == NULL) ++ if (username == NULL) { ++ username = getlogin (); ++ if (username == NULL) ++ username = getpwuid (getuid ())->pw_name; + gtk_editable_set_text (GTK_EDITABLE (self->remote_desktop_username_entry), +- getlogin ()); ++ username); ++ } + if (password == NULL) + gtk_editable_set_text (GTK_EDITABLE (self->remote_desktop_password_entry), + pw_generate ()); +-- +GitLab + diff --git a/gnome-control-center.changes b/gnome-control-center.changes index f5389a2..0ecfa1b 100644 --- a/gnome-control-center.changes +++ b/gnome-control-center.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Wed Mar 30 05:25:34 UTC 2022 - Luciano Santos + +- Add gnome-control-center-42.0-fix-sharing-panel-crash.patch, + based on commit c2f088ac5220f3a64edc2c15e60fc0d7f1dfc9e5, to fix + Sharing panel segfaulting due to getlogin() returning NULL rather + than the username (boo#1197529, + glgo#GNOME/gnome-control-center!1727). + ------------------------------------------------------------------- Tue Mar 29 13:54:31 UTC 2022 - Atri Bhattacharya diff --git a/gnome-control-center.spec b/gnome-control-center.spec index be0706b..a45fb3c 100644 --- a/gnome-control-center.spec +++ b/gnome-control-center.spec @@ -37,9 +37,15 @@ Source0: https://download.gnome.org/sources/gnome-control-center/42/%{nam # PATCH-NEEDS-REBASE gnome-control-center-disable-error-message-for-NM.patch bsc#989801 sckang@suse.com -- network: Improve the check for whether NM or wicked is running Was:PATCH-FIX-OPENSUSE Patch0: gnome-control-center-disable-error-message-for-NM.patch # PATCH-FIX-UPSTREAM gnome-control-center-reload-vpn-plugins.patch glgo#GNOME/gnome-control-center!1263 sckang@suse.com -- network/connection-editor: always load all available VPN plugins -Patch3: gnome-control-center-reload-vpn-plugins.patch +Patch1: gnome-control-center-reload-vpn-plugins.patch # PATCH-FIX_UPSTREAM gnome-control-center-goa-helper-on-X11.patch glgo#GNOME/gnome-control-center!1651 badshah400@gmail.com -- Fix GOA helper not showing up on X11 -Patch4: gnome-control-center-goa-helper-on-X11.patch +Patch2: gnome-control-center-goa-helper-on-X11.patch +# PATCH-FIX-UPSTREAM gnome-control-center-42.0-fix-sharing-panel-crash.patch -- luc14n0@opensuse.org +# Sharing panel crashes when inicialized due to getlogin() returning NULL rather than the username. +# Upstream issue: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1727 +# Bug report: https://bugzilla.opensuse.org/show_bug.cgi?id=1197529 +# Based on commit: c2f088ac5220f3a64edc2c15e60fc0d7f1dfc9e5 +Patch3: gnome-control-center-42.0-fix-sharing-panel-crash.patch ### patches for Leap >= 15 plus SLE >= 15, but not TW # PATCH-FEATURE-SLE gnome-control-center-info-never-use-gnome-software.patch bsc#999336 fezhang@suse.com -- info: Never search for gnome-software as an option when checking for updates on SLE and Leap 42.2, because we use gpk-update-viewer. @@ -104,6 +110,15 @@ BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(xcursor) BuildRequires: pkgconfig(xft) BuildRequires: pkgconfig(xi) >= 1.2 +## CONDITIONAL BUILD REQUIREMENTS +%if %{with wacom} +BuildRequires: pkgconfig(clutter-1.0) >= 1.11.3 +BuildRequires: pkgconfig(libwacom) >= 0.7 +%endif +%if %{with ibus} +BuildRequires: pkgconfig(ibus-1.0) >= 1.5.2 +%endif +## Requires: gnome-settings-daemon >= 41 # needed for universal access panel Requires: gnome-themes-accessibility @@ -122,13 +137,6 @@ Recommends: dbus(com.intel.dleyna-server) Recommends: system-config-printer-dbus-service # For the power panel Recommends: power-profiles-daemon -%if %{with wacom} -BuildRequires: pkgconfig(clutter-1.0) >= 1.11.3 -BuildRequires: pkgconfig(libwacom) >= 0.7 -%endif -%if %{with ibus} -BuildRequires: pkgconfig(ibus-1.0) >= 1.5.2 -%endif %description The control center is GNOME's main interface for configuration of @@ -182,8 +190,9 @@ GNOME control center. %setup -q # Patch needs rebase #%%patch0 -p1 +%patch1 -p1 +%patch2 -p1 %patch3 -p1 -%patch4 -p1 # patches for Leap >= 15 plus SLE >= 15, but not TW %if 0%{?sle_version} >= 150000