[gnome-bluetooth/f18] Don't crash on unknown rfkill types

drago01 drago01 at fedoraproject.org
Thu May 16 13:51:50 UTC 2013


commit a0df99e247984ff8413f17276b643f55cead500d
Author: Adel Gadllah <adel.gadllah at gmail.com>
Date:   Thu May 16 15:34:27 2013 +0200

    Don't crash on unknown rfkill types

 ...-Don-t-use-g_assert_not_reached-in-type_t.patch |   27 ++++++++++++++++++++
 gnome-bluetooth.spec                               |    8 ++++-
 2 files changed, 33 insertions(+), 2 deletions(-)
---
diff --git a/0001-rfkill-glib-Don-t-use-g_assert_not_reached-in-type_t.patch b/0001-rfkill-glib-Don-t-use-g_assert_not_reached-in-type_t.patch
new file mode 100644
index 0000000..af6ede7
--- /dev/null
+++ b/0001-rfkill-glib-Don-t-use-g_assert_not_reached-in-type_t.patch
@@ -0,0 +1,27 @@
+From 9932a6316be777d47b89323c9b8ae132c3676830 Mon Sep 17 00:00:00 2001
+From: Adel Gadllah <adel.gadllah at gmail.com>
+Date: Thu, 16 May 2013 15:31:17 +0200
+Subject: [PATCH] rfkill-glib: Don't use g_assert_not_reached in type_to_string
+
+New kernel versions can add new RFKILL types, we should now crash here,
+just say that we don't know what the switch is.
+---
+ lib/rfkill-glib.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/rfkill-glib.c b/lib/rfkill-glib.c
+index 039e80a..6f15702 100644
+--- a/lib/rfkill-glib.c
++++ b/lib/rfkill-glib.c
+@@ -80,7 +80,7 @@ type_to_string (unsigned int type)
+ 	case RFKILL_TYPE_WWAN:
+ 		return "WWAN";
+ 	default:
+-		g_assert_not_reached ();
++		return "UNKNOWN";
+ 	}
+ }
+ 
+-- 
+1.8.1.4
+
diff --git a/gnome-bluetooth.spec b/gnome-bluetooth.spec
index 10a08f1..3d48186 100644
--- a/gnome-bluetooth.spec
+++ b/gnome-bluetooth.spec
@@ -1,7 +1,7 @@
 Name:		gnome-bluetooth
 Epoch:		1
 Version:	3.6.1
-Release:	2%{?dist}
+Release:	3%{?dist}
 Summary:	Bluetooth graphical utilities
 
 Group:		Applications/Communications
@@ -9,7 +9,7 @@ License:	GPLv2+
 URL:		http://live.gnome.org/GnomeBluetooth
 Source0:	http://download.gnome.org/sources/gnome-bluetooth/3.6/gnome-bluetooth-%{version}.tar.xz
 Source1:	61-gnome-bluetooth-rfkill.rules
-
+Patch1:     0001-rfkill-glib-Don-t-use-g_assert_not_reached-in-type_t.patch
 %if 0%{?rhel}
 ExcludeArch:	s390 s390x
 %endif
@@ -73,6 +73,7 @@ for writing applications that require a Bluetooth device selection widget.
 
 %prep
 %setup -q
+%patch1 -p1
 
 %build
 %configure --disable-desktop-update --disable-icon-update --enable-nautilus-sendto=yes --disable-schemas-compile
@@ -181,6 +182,9 @@ fi
 %{_datadir}/gtk-doc
 
 %changelog
+* Thu May 16 2013 Adel Gadllah <adel.gadllah at gmail.com> - 1:3.6.1-3
+- Don't crash on unknown rfkill types
+
 * Thu Nov 29 2012 Dan HorĂ¡k <dan[at]danny.cz> - 1:3.6.1-2
 - revive on Fedora/s390x, but drop Requires there - it's needed to fulfil compose dependencies
 


More information about the scm-commits mailing list