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

Kalev Lember kalev at fedoraproject.org
Mon Jun 3 14:20:05 UTC 2013


commit 8b1ca5c8da996e20b862c2adca0fa9d0fddf0c13
Author: Kalev Lember <kalevlember at gmail.com>
Date:   Mon Jun 3 15:54:21 2013 +0200

    Don't crash on unknown rfkill types

 gnome-bluetooth-3.4.2-rfkill.patch |   30 ++++++++++++++++++++++++++++++
 gnome-bluetooth.spec               |    8 +++++++-
 2 files changed, 37 insertions(+), 1 deletions(-)
---
diff --git a/gnome-bluetooth-3.4.2-rfkill.patch b/gnome-bluetooth-3.4.2-rfkill.patch
new file mode 100644
index 0000000..1553e96
--- /dev/null
+++ b/gnome-bluetooth-3.4.2-rfkill.patch
@@ -0,0 +1,30 @@
+Backport of the following commit from upstream; adapted to apply to
+gnome-bluetooth 3.4:
+
+
+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(-)
+
+
+--- a/lib/bluetooth-killswitch.c
++++ b/lib/bluetooth-killswitch.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 bd3f190..f65cbe4 100644
--- a/gnome-bluetooth.spec
+++ b/gnome-bluetooth.spec
@@ -1,7 +1,7 @@
 Name:		gnome-bluetooth
 Epoch:		1
 Version:	3.4.2
-Release:	1%{?dist}
+Release:	2%{?dist}
 Summary:	Bluetooth graphical utilities
 
 Group:		Applications/Communications
@@ -9,6 +9,8 @@ License:	GPLv2+
 URL:		http://live.gnome.org/GnomeBluetooth
 Source0:	http://download.gnome.org/sources/gnome-bluetooth/3.3/gnome-bluetooth-%{version}.tar.xz
 Source1:	61-gnome-bluetooth-rfkill.rules
+# Upstream fix, backported to 3.4.2: Don't crash on unknown rfkill types
+Patch1:		gnome-bluetooth-3.4.2-rfkill.patch
 
 ExcludeArch:	s390 s390x
 
@@ -69,6 +71,7 @@ for writing applications that require a Bluetooth device selection widget.
 
 %prep
 %setup -q
+%patch1 -p1 -b .rfkill
 
 %build
 %configure --disable-desktop-update --disable-icon-update --enable-nautilus-sendto=yes --disable-schemas-compile
@@ -180,6 +183,9 @@ fi
 %{_datadir}/gtk-doc
 
 %changelog
+* Mon Jun 03 2013 Kalev Lember <kalevlember at gmail.com> 3.4.2-2
+- Don't crash on unknown rfkill types
+
 * Wed Jul 04 2012 Bastien Nocera <bnocera at redhat.com> 3.4.2-1
 - Update to 3.4.2
 


More information about the scm-commits mailing list