From cb45e8da6727c39b5f37d9a25a12ebedb40f95d4 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 12 Feb 2013 11:43:59 -0500 Subject: [PATCH] Fix osinfo-detect crash with non-bootable media (bz #901910) --- ...Fix-segfault-with-non-bootable-media.patch | 42 +++++++++++++++++++ libosinfo.spec | 8 +++- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 0001-osinfo-detect-Fix-segfault-with-non-bootable-media.patch diff --git a/0001-osinfo-detect-Fix-segfault-with-non-bootable-media.patch b/0001-osinfo-detect-Fix-segfault-with-non-bootable-media.patch new file mode 100644 index 0000000..67e9368 --- /dev/null +++ b/0001-osinfo-detect-Fix-segfault-with-non-bootable-media.patch @@ -0,0 +1,42 @@ +From e17fc3a461a70c7a2a881d48eb2d79d4b852c050 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Cole Robinson +Date: Fri, 8 Feb 2013 13:37:53 -0500 +Subject: [PATCH] osinfo-detect: Fix segfault with non bootable media + +With a movie DVD in my drive: + +$ osinfo-detect -f env /dev/cdrom +OSINFO_BOOTABLE=0 + +** (osinfo-detect:24211): CRITICAL **: osinfo_db_identify_media: assertion `OSINFO_IS_MEDIA(media)' failed + +(osinfo-detect:24211): GLib-GObject-CRITICAL **: g_object_get: assertion `G_IS_OBJECT (object)' failed +Segmentation fault (core dumped) + +We weren't exiting after detecting the media as non bootable. + +https://bugzilla.redhat.com/show_bug.cgi?id=901910 +--- + tools/osinfo-detect.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/osinfo-detect.c b/tools/osinfo-detect.c +index 1262783..0f837de 100644 +--- a/tools/osinfo-detect.c ++++ b/tools/osinfo-detect.c +@@ -238,10 +238,10 @@ gint main(gint argc, gchar **argv) + g_printerr(_("Error parsing media: %s\n"), error->message); + + ret = -3; +- goto EXIT; + } else { + print_bootable(FALSE); + } ++ goto EXIT; + } else { + print_bootable(TRUE); + } +-- +1.8.1 + diff --git a/libosinfo.spec b/libosinfo.spec index 6c23374..ca937bc 100644 --- a/libosinfo.spec +++ b/libosinfo.spec @@ -13,10 +13,12 @@ Summary: A library for managing OS information for virtualization Name: libosinfo Version: 0.2.3 -Release: 1%{?dist}%{?extra_release} +Release: 2%{?dist}%{?extra_release} License: LGPLv2+ Group: Development/Libraries Source: https://fedorahosted.org/releases/l/i/%{name}/%{name}-%{version}.tar.gz +# Fix osinfo-detect crash with non-bootable media (bz 901910) +Patch1: 0001-osinfo-detect-Fix-segfault-with-non-bootable-media.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) URL: https://fedorahosted.org/libosinfo/ BuildRequires: intltool @@ -65,6 +67,7 @@ This package provides the Vala bindings for libosinfo library. %prep %setup -q +%patch1 -p1 %build %if %{with_gir} @@ -142,6 +145,9 @@ rm -fr %{buildroot} %{_datadir}/vala/vapi/libosinfo-1.0.vapi %changelog +* Tue Feb 12 2013 Cole Robinson - 0.2.3-2 +- Fix osinfo-detect crash with non-bootable media (bz #901910) + * Mon Jan 14 2013 Zeeshan Ali - 0.2.3-1 - New upstream release 0.2.3