rpms/hal/devel hal-0.5.10-fdi-cache-regen.patch, NONE, 1.1 hal-0.5.10-fdi-empty-match-rule.patch, NONE, 1.1 hal-0.5.10-fdi-endless-loop.patch, NONE, 1.1 hal.spec, 1.140, 1.141

David Zeuthen (davidz) fedora-extras-commits at redhat.com
Tue Jan 8 19:36:18 UTC 2008


Author: davidz

Update of /cvs/pkgs/rpms/hal/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv30860

Modified Files:
	hal.spec 
Added Files:
	hal-0.5.10-fdi-cache-regen.patch 
	hal-0.5.10-fdi-empty-match-rule.patch 
	hal-0.5.10-fdi-endless-loop.patch 
Log Message:
* Tue Jan  8 2008 David Zeuthen <davidz at redhat.com> - 0.5.10-4%{?dist}
- Backport some upstream patches that fixes crashers with fdi files



hal-0.5.10-fdi-cache-regen.patch:

--- NEW FILE hal-0.5.10-fdi-cache-regen.patch ---
From: Danny Kukawka <danny.kukawka at web.de>
Date: Thu, 6 Dec 2007 20:16:02 +0000 (+0100)
Subject: fix possible segfault on fdi-cache recreation
X-Git-Url: http://gitweb.freedesktop.org/?p=hal.git;a=commitdiff;h=ab31f06ca5388d4915156d3dac60c3fc52908260

fix possible segfault on fdi-cache recreation

This fixes https://bugzilla.novell.com/show_bug.cgi?id=344231, where
HAL crash if a fdi-file get changed/updated and a new device appears
after the recreation of the FDI cache.
---

--- a/hald/device_info.c
+++ b/hald/device_info.c
@@ -1119,13 +1119,15 @@ rules_match_and_merge_device (void *fdi_
 /* merge the device info type, either preprobe, info or policy */
 gboolean
 di_search_and_merge (HalDevice *d, DeviceInfoType type){
-	struct cache_header *header = (struct cache_header*) RULES_PTR(0);
+	struct cache_header *header;
 
         /* make sure our fdi rule cache is up to date */
         if (di_cache_coherency_check (FALSE)) {
                 di_rules_init ();
 	}
 
+	header = (struct cache_header*) RULES_PTR(0);
+
 	switch (type) {
 	case DEVICE_INFO_TYPE_PREPROBE:
 		/* Checking if we have at least one preprobe rule */

hal-0.5.10-fdi-empty-match-rule.patch:

--- NEW FILE hal-0.5.10-fdi-empty-match-rule.patch ---
From: Sjoerd Simons <sjoerd at luon.net>
Date: Sat, 22 Dec 2007 14:42:54 +0000 (+0100)
Subject: ensure match rules are always stored before writing the jump_position in the cache
X-Git-Url: http://gitweb.freedesktop.org/?p=hal.git;a=commitdiff;h=75965fdc42620f57bdf9c9138f9d30f0af5b284d

ensure match rules are always stored before writing the jump_position in the cache

When a match rule is empty the expat end callback is called while the match
rule isn't saved yet. This patch ensures the match rule is saved _before_
saving the jump_positions, if this is not done then the jump_position will be
overwritten with 0.

Fixes hal aborting on Fujitsu laptops because the fujitsu fdi contains an
empty <match /> rule. Reported in
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=456314 and its  dupes
---

--- a/hald/create_cache.c
+++ b/hald/create_cache.c
@@ -432,6 +432,11 @@ end (void *data, const char *el){
 
 	if (rtype == RULE_UNKNOWN) return;
 	if (rtype == RULE_MATCH){
+		if (fdi_ctx->rule.rtype == RULE_MATCH) {
+			/* the match rule wasn't stored yet, store it now. So it's stored
+			* _before_ jump_position is written into the cache */
+			store_rule(fdi_ctx);
+		}
 		set_jump_position(fdi_ctx);
 		return;
 	}

hal-0.5.10-fdi-endless-loop.patch:

--- NEW FILE hal-0.5.10-fdi-endless-loop.patch ---
From: Danny Kukawka <danny.kukawka at web.de>
Date: Mon, 26 Nov 2007 17:52:21 +0000 (+0100)
Subject: fix endless loop on empty match rules in fdi-files
X-Git-Url: http://gitweb.freedesktop.org/?p=hal.git;a=commitdiff;h=111326d934c783716582eb3d4af1bc992421109c

fix endless loop on empty match rules in fdi-files

Fixed endless loop on empty fdi (match) rules. Simply jump to the next
rule if this happen.
---

--- a/hald/device_info.c
+++ b/hald/device_info.c
@@ -1109,6 +1109,7 @@ rules_match_and_merge_device (void *fdi_
 
 		default:
 			HAL_WARNING(("Unhandled rule (%i)!", rule->rtype));
+			rule = di_jump(rule);
 			break;
 		}
 		rule = di_next(rule);


Index: hal.spec
===================================================================
RCS file: /cvs/pkgs/rpms/hal/devel/hal.spec,v
retrieving revision 1.140
retrieving revision 1.141
diff -u -r1.140 -r1.141
--- hal.spec	6 Dec 2007 07:01:31 -0000	1.140
+++ hal.spec	8 Jan 2008 19:35:18 -0000	1.141
@@ -26,10 +26,14 @@
 Summary: Hardware Abstraction Layer
 Name: hal
 Version: 0.5.10
-Release: 3%{?dist}
+Release: 4%{?dist}
 URL: http://www.freedesktop.org/Software/hal
 Source0: http://hal.freedesktop.org/releases/%{name}-%{version}.tar.gz
 
+Patch0: hal-0.5.10-fdi-endless-loop.patch
+Patch1: hal-0.5.10-fdi-cache-regen.patch
+Patch2: hal-0.5.10-fdi-empty-match-rule.patch
+
 License: AFL/GPL
 Group: System Environment/Libraries
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) 
@@ -121,6 +125,9 @@
 
 %prep
 %setup -q
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
 
 %build
 %configure --enable-docbook-docs --docdir=%{_datadir}/doc/%{name}-%{version} --with-os-type=redhat --enable-console-kit --enable-policy-kit --enable-acl-management --enable-umount-helper --enable-acpi-ibm --enable-acpi-toshiba --with-eject=/usr/sbin/eject
@@ -236,6 +243,9 @@
 %{_datadir}/gtk-doc/html/libhal-storage/*
 
 %changelog
+* Tue Jan  8 2008 David Zeuthen <davidz at redhat.com> - 0.5.10-4%{?dist}
+- Backport some upstream patches that fixes crashers with fdi files
+
 * Thu Dec  6 2007 David Zeuthen <davidz at redhat.com> - 0.5.10-3%{?dist}
 - Grant user 'haldaemon' an authorization to read authorizations of other users
 




More information about the fedora-extras-commits mailing list