diff options
author | 2007-04-17 16:26:30 +0000 | |
---|---|---|
committer | 2007-04-17 16:26:30 +0000 | |
commit | d29f2dd7796929a939744137be9986d9367df45f (patch) | |
tree | 609930f26adab535687cf38f34673a286a79ae1b /sys-apps/hal/files | |
parent | add gnome-common dep to build (diff) | |
download | gentoo-2-d29f2dd7796929a939744137be9986d9367df45f.tar.gz gentoo-2-d29f2dd7796929a939744137be9986d9367df45f.tar.bz2 gentoo-2-d29f2dd7796929a939744137be9986d9367df45f.zip |
Clean up init script. Add HALD_VERBOSE to conf.d script. Add some proposed patches to fix volume label segfault as experienced on sparc. Removed old patches.
(Portage version: 2.1.2.4)
Diffstat (limited to 'sys-apps/hal/files')
-rw-r--r-- | sys-apps/hal/files/0.5.9-hald.conf | 6 | ||||
-rw-r--r-- | sys-apps/hal/files/0.5.9-hald.rc | 5 | ||||
-rw-r--r-- | sys-apps/hal/files/0.5.9/11_hal_fix_segfault_probe_volume.patch | 69 | ||||
-rw-r--r-- | sys-apps/hal/files/0.5.9/12_hal_fix-vol_label_probe_volume.patch | 74 | ||||
-rw-r--r-- | sys-apps/hal/files/0.5.9/series | 2 | ||||
-rw-r--r-- | sys-apps/hal/files/fix-scsi-fake-host-event.patch | 107 | ||||
-rw-r--r-- | sys-apps/hal/files/hal-0.5.1-old_storage_policy.patch | 12 | ||||
-rw-r--r-- | sys-apps/hal/files/hal-0.5.5.1-RBC.patch | 18 | ||||
-rw-r--r-- | sys-apps/hal/files/hal-0.5.9-update_dtd.patch | 21 |
9 files changed, 153 insertions, 161 deletions
diff --git a/sys-apps/hal/files/0.5.9-hald.conf b/sys-apps/hal/files/0.5.9-hald.conf index 2578065b236d..9b49452d4c71 100644 --- a/sys-apps/hal/files/0.5.9-hald.conf +++ b/sys-apps/hal/files/0.5.9-hald.conf @@ -3,4 +3,8 @@ #rc-update add consolekit default since people #forget or don't read ewarn and then complain their system is broken #ONCE AGAIN DO NOT TOUCH THE LINE BELOW THIS -RC_NEED +RC_NEED="" + +# Should HAL be verbose to syslog? This is needed for debugging +# HAL. +HALD_VERBOSE="no" diff --git a/sys-apps/hal/files/0.5.9-hald.rc b/sys-apps/hal/files/0.5.9-hald.rc index 37f8944f55d7..8da96f15da42 100644 --- a/sys-apps/hal/files/0.5.9-hald.rc +++ b/sys-apps/hal/files/0.5.9-hald.rc @@ -1,7 +1,7 @@ #!/sbin/runscript # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License, v2 or later -# $Header: /var/cvsroot/gentoo-x86/sys-apps/hal/files/0.5.9-hald.rc,v 1.3 2007/04/10 00:38:16 cardoe Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/hal/files/0.5.9-hald.rc,v 1.4 2007/04/17 16:26:30 cardoe Exp $ depend() { need dbus @@ -10,6 +10,7 @@ depend() { } start() { + [ -z "${HALD_VERBOSE}" ] && HALD_VERBOSE="no" ebegin "Starting Hardware Abstraction Layer daemon" if [ -f /proc/acpi/event ]; then @@ -17,7 +18,7 @@ start() { chmod 440 /proc/acpi/event fi - start-stop-daemon --start -q --exec /usr/sbin/hald -- --use-syslog + start-stop-daemon --start -q --exec /usr/sbin/hald -- --use-syslog --verbose=${HALD_VERBOSE} eend $? } diff --git a/sys-apps/hal/files/0.5.9/11_hal_fix_segfault_probe_volume.patch b/sys-apps/hal/files/0.5.9/11_hal_fix_segfault_probe_volume.patch new file mode 100644 index 000000000000..2b1db74ec0f3 --- /dev/null +++ b/sys-apps/hal/files/0.5.9/11_hal_fix_segfault_probe_volume.patch @@ -0,0 +1,69 @@ +commit f6fbf88c4af259bc4670f5d48c93ab4f70838074 +Author: Danny Kukawka <danny.kukawka@web.de> +Date: Tue Apr 17 14:38:03 2007 +0200 + + fix possible segfault in probe-volume if vid->type == NULL + + Fix possible segfaults in probe-volume and libhal if vid->type == NULL. Added + checks for vid->type != NULL to probe-volume.c and new checks for parameter + (LIBHAL_CHECK_PARAM_VALID) of libhal_changeset_set_property_string(). + + This fix also fd.o bug #10429. + +diff --git a/hald/linux/probing/probe-volume.c b/hald/linux/probing/probe-volume.c +index d5963db..b5f71c0 100644 +--- a/hald/linux/probing/probe-volume.c ++++ b/hald/linux/probing/probe-volume.c +@@ -122,8 +122,11 @@ set_volume_id_values (LibHalContext *ctx, const char *udi, LibHalChangeSet *cs, + libhal_changeset_set_property_string (cs, "volume.fsusage", usage); + HAL_DEBUG (("volume.fsusage = '%s'", usage)); + +- libhal_changeset_set_property_string (cs, "volume.fstype", vid->type); ++ if (!libhal_changeset_set_property_string (cs, "volume.fstype", vid->type)) ++ libhal_changeset_set_property_string (cs, "volume.fstype", ""); ++ + HAL_DEBUG(("volume.fstype = '%s'", vid->type)); ++ + if (vid->type_version[0] != '\0') { + libhal_changeset_set_property_string (cs, "volume.fsversion", vid->type_version); + HAL_DEBUG(("volume.fsversion = '%s'", vid->type_version)); +@@ -141,12 +144,23 @@ set_volume_id_values (LibHalContext *ctx, const char *udi, LibHalChangeSet *cs, + libhal_changeset_set_property_string (cs, "info.product", volume_label); + } + else { +- snprintf (buf, sizeof (buf), "Volume (%s)", vid->type); ++ if (vid->type != NULL) { ++ snprintf (buf, sizeof (buf), "Volume (%s)", vid->type); ++ } else { ++ snprintf (buf, sizeof (buf), "Volume (unknown)"); ++ } ++ + libhal_changeset_set_property_string (cs, "info.product", buf); ++ + } + g_free(volume_label); + } else { +- snprintf (buf, sizeof (buf), "Volume (%s)", vid->type); ++ if (vid->type != NULL) { ++ snprintf (buf, sizeof (buf), "Volume (%s)", vid->type); ++ } else { ++ snprintf (buf, sizeof (buf), "Volume (unknown)"); ++ } ++ + libhal_changeset_set_property_string (cs, "info.product", buf); + } + } +diff --git a/libhal/libhal.c b/libhal/libhal.c +index 4ddac9e..fb9800a 100644 +--- a/libhal/libhal.c ++++ b/libhal/libhal.c +@@ -3810,6 +3810,9 @@ libhal_changeset_set_property_string (LibHalChangeSet *changeset, const char *ke + { + LibHalChangeSetElement *elem; + ++ LIBHAL_CHECK_PARAM_VALID(key, "*key", FALSE); ++ LIBHAL_CHECK_PARAM_VALID(value, "*value", FALSE); ++ + elem = calloc (1, sizeof (LibHalChangeSetElement)); + if (elem == NULL) + goto out; diff --git a/sys-apps/hal/files/0.5.9/12_hal_fix-vol_label_probe_volume.patch b/sys-apps/hal/files/0.5.9/12_hal_fix-vol_label_probe_volume.patch new file mode 100644 index 000000000000..68b61279a32d --- /dev/null +++ b/sys-apps/hal/files/0.5.9/12_hal_fix-vol_label_probe_volume.patch @@ -0,0 +1,74 @@ +commit 674d2415aed43b43b81b262cbad2228f0477e34a +Author: Danny Kukawka <danny.kukawka@web.de> +Date: Tue Apr 17 15:09:22 2007 +0200 + + fix problems with case if vid->label[0] is '\0' + + Fix problems with the case where vid->label[0] is '\0'. Don't call + strdup_valid_utf8 in this case, simply ignore the label in this case. + Cleaned up the code to prevent code duplication. + + This fix fd.o bug #10362. + +diff --git a/hald/linux/probing/probe-volume.c b/hald/linux/probing/probe-volume.c +index b5f71c0..b003b25 100644 +--- a/hald/linux/probing/probe-volume.c ++++ b/hald/linux/probing/probe-volume.c +@@ -131,38 +131,34 @@ set_volume_id_values (LibHalContext *ctx, const char *udi, LibHalChangeSet *cs, + libhal_changeset_set_property_string (cs, "volume.fsversion", vid->type_version); + HAL_DEBUG(("volume.fsversion = '%s'", vid->type_version)); + } ++ + libhal_changeset_set_property_string (cs, "volume.uuid", vid->uuid); + HAL_DEBUG(("volume.uuid = '%s'", vid->uuid)); + +- /* we need to be sure for a utf8 valid label, because dbus accept only utf8 valid strings */ +- volume_label = strdup_valid_utf8 (vid->label); +- if( volume_label != NULL ) { +- libhal_changeset_set_property_string (cs, "volume.label", volume_label); +- HAL_DEBUG(("volume.label = '%s'", volume_label)); ++ if(vid->label != NULL && vid->label[0] != '\0') { ++ /* we need to be sure for a utf8 valid label, because dbus accept only utf8 valid strings */ ++ volume_label = strdup_valid_utf8 (vid->label); ++ if( volume_label != NULL ) { ++ libhal_changeset_set_property_string (cs, "volume.label", volume_label); ++ HAL_DEBUG(("volume.label = '%s'", volume_label)); + +- if (strlen(volume_label) > 0) { +- libhal_changeset_set_property_string (cs, "info.product", volume_label); +- } +- else { +- if (vid->type != NULL) { +- snprintf (buf, sizeof (buf), "Volume (%s)", vid->type); +- } else { +- snprintf (buf, sizeof (buf), "Volume (unknown)"); ++ if (strlen(volume_label) > 0) { ++ libhal_changeset_set_property_string (cs, "info.product", volume_label); ++ g_free(volume_label); ++ return; + } + +- libhal_changeset_set_property_string (cs, "info.product", buf); +- +- } +- g_free(volume_label); +- } else { +- if (vid->type != NULL) { +- snprintf (buf, sizeof (buf), "Volume (%s)", vid->type); +- } else { +- snprintf (buf, sizeof (buf), "Volume (unknown)"); ++ g_free(volume_label); + } ++ } + +- libhal_changeset_set_property_string (cs, "info.product", buf); ++ if (vid->type != NULL) { ++ snprintf (buf, sizeof (buf), "Volume (%s)", vid->type); ++ } else { ++ snprintf (buf, sizeof (buf), "Volume (unknown)"); + } ++ ++ libhal_changeset_set_property_string (cs, "info.product", buf); + } + + static void diff --git a/sys-apps/hal/files/0.5.9/series b/sys-apps/hal/files/0.5.9/series index 29ad87df2dd1..262056b976ac 100644 --- a/sys-apps/hal/files/0.5.9/series +++ b/sys-apps/hal/files/0.5.9/series @@ -8,5 +8,7 @@ 08_contains_not_fdi_directive.patch 09_hald_addon_keyboard_start_one.patch 10_freebsd_storage_reprobe_fix.patch +11_hal_fix_segfault_probe_volume.patch +12_hal_fix-vol_label_probe_volume.patch 95_gentoo_man_page.patch 96_plugdev_allow_send.patch diff --git a/sys-apps/hal/files/fix-scsi-fake-host-event.patch b/sys-apps/hal/files/fix-scsi-fake-host-event.patch deleted file mode 100644 index 8101a788f7d4..000000000000 --- a/sys-apps/hal/files/fix-scsi-fake-host-event.patch +++ /dev/null @@ -1,107 +0,0 @@ -diff --git a/hald/linux/device.c b/hald/linux/device.c -index d109e9b..1211535 100644 ---- a/hald/linux/device.c -+++ b/hald/linux/device.c -@@ -533,27 +533,52 @@ missing_scsi_host (const gchar *sysfs_pa - gchar path[HAL_PATH_MAX]; - HalDevice *d; - HotplugEvent *host_event; -+ const gchar *last_elem; -+ gint host_num, bus_num, target_num, lun_num; -+ int max; -+ gint num = -1; - int rc = FALSE; - -- g_strlcpy(path, sysfs_path, sizeof(path)); -- /* skip device */ -- if (!hal_util_path_ascend (path)) -+ /* catch only scsi-devices */ -+ last_elem = hal_util_get_last_element (sysfs_path); -+ if (sscanf (last_elem, "%d:%d:%d:%d", &host_num, &bus_num, &target_num, &lun_num) != 4) - goto out; -- /* skip target */ -- if (!hal_util_path_ascend (path)) -+ -+ /* avoid loops */ -+ if (device_event->reposted) - goto out; -- if (strstr (path, "/host") == NULL) -+ -+ /* search devpath for missing host */ -+ g_strlcpy(path, sysfs_path, sizeof(path)); -+ max = 100; -+ while (max--) { -+ if (!hal_util_path_ascend (path)) -+ goto out; -+ -+ last_elem = hal_util_get_last_element (path); -+ if (sscanf (last_elem, "host%d", &num) == 1) -+ break; -+ } -+ -+ /* the device must belong to this host */ -+ if (host_num != num) - goto out; - -+ /* look if host is present */ - d = hal_device_store_match_key_value_string (hald_get_gdl (), - "linux.sysfs_path", - path); -+ -+ /* skip "add" if host is already created */ - if (action == HOTPLUG_ACTION_ADD && d != NULL) - goto out; -+ -+ /* skip "remove" if host does not exist */ - if (action == HOTPLUG_ACTION_REMOVE && d == NULL) - goto out; -- rc = TRUE; - -+ /* fake host event */ -+ rc = TRUE; - host_event = g_new0 (HotplugEvent, 1); - host_event->action = action; - host_event->type = HOTPLUG_EVENT_SYSFS_DEVICE; -@@ -561,15 +586,17 @@ missing_scsi_host (const gchar *sysfs_pa - g_strlcpy (host_event->sysfs.sysfs_path, path, sizeof (host_event->sysfs.sysfs_path)); - host_event->sysfs.net_ifindex = -1; - -+ /* insert host before our event, so we can see it as parent */ - if (action == HOTPLUG_ACTION_ADD) { - hotplug_event_enqueue_at_front (device_event); - hotplug_event_enqueue_at_front (host_event); - hotplug_event_reposted (device_event); - goto out; - } -+ -+ /* remove host */ - if (action == HOTPLUG_ACTION_REMOVE) - hotplug_event_enqueue (host_event); -- - out: - return rc; - } -diff --git a/hald/linux/hotplug.c b/hald/linux/hotplug.c -index 986b96c..96c8540 100644 ---- a/hald/linux/hotplug.c -+++ b/hald/linux/hotplug.c -@@ -74,6 +74,7 @@ hotplug_event_reposted (void *end_token) - { - HotplugEvent *hotplug_event = (HotplugEvent *) end_token; - -+ hotplug_event->reposted = TRUE; - hotplug_events_in_progress = g_slist_remove (hotplug_events_in_progress, hotplug_event); - } - -diff --git a/hald/linux/hotplug.h b/hald/linux/hotplug.h -index 2daf982..b9c3501 100644 ---- a/hald/linux/hotplug.h -+++ b/hald/linux/hotplug.h -@@ -54,6 +54,7 @@ typedef struct - { - HotplugActionType action; /* Whether the event is add or remove */ - HotplugEventType type; /* Type of event */ -+ gboolean reposted; /* Avoid loops */ - - void (*free_function) (gpointer data); - diff --git a/sys-apps/hal/files/hal-0.5.1-old_storage_policy.patch b/sys-apps/hal/files/hal-0.5.1-old_storage_policy.patch deleted file mode 100644 index d84732ce7c9b..000000000000 --- a/sys-apps/hal/files/hal-0.5.1-old_storage_policy.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- fdi/policy/10osvendor/10-storage-policy.fdi.old 2005-03-29 15:19:35.000000000 -0500 -+++ fdi/policy/10osvendor/10-storage-policy.fdi 2005-05-08 06:29:18.000000000 -0400 -@@ -10,7 +10,8 @@ - <merge key="storage.policy.default.managed_keyword.primary" type="string">managed</merge> - <merge key="storage.policy.default.managed_keyword.secondary" type="string">kudzu</merge> - <merge key="storage.policy.default.mount_option.noauto" type="bool">true</merge> -- <merge key="storage.policy.default.mount_option.pamconsole" type="bool">true</merge> -+ <merge key="storage.policy.default.mount_option.pamconsole" type="bool">false</merge> -+ <merge key="storage.policy.default.mount_option.user" type="bool">true</merge> - <merge key="storage.policy.default.mount_option.exec" type="bool">true</merge> - </match> - </device> diff --git a/sys-apps/hal/files/hal-0.5.5.1-RBC.patch b/sys-apps/hal/files/hal-0.5.5.1-RBC.patch deleted file mode 100644 index ce906e3e5ed7..000000000000 --- a/sys-apps/hal/files/hal-0.5.5.1-RBC.patch +++ /dev/null @@ -1,18 +0,0 @@ -Index: hald/linux2/blockdev.c -=================================================================== -RCS file: /cvs/hal/hal/hald/linux2/blockdev.c,v -retrieving revision 1.27 -diff -u -3 -p -r1.27 blockdev.c ---- hald/linux2/blockdev.c 2 Nov 2005 15:38:13 -0000 1.27 -+++ hald/linux2/blockdev.c 28 Nov 2005 23:04:24 -0000 -@@ -827,7 +827,8 @@ hotplug_event_begin_add_blockdev (const - - /* These magic values are documented in the kernel source */ - switch (type) { -- case 0: /* Disk */ -+ case 0: /* Disk */ -+ case 14: /* Simple Direct Access Device, set it to disk */ - hal_device_property_set_string (d, "storage.drive_type", "disk"); - break; - - diff --git a/sys-apps/hal/files/hal-0.5.9-update_dtd.patch b/sys-apps/hal/files/hal-0.5.9-update_dtd.patch deleted file mode 100644 index b6e8807bfc77..000000000000 --- a/sys-apps/hal/files/hal-0.5.9-update_dtd.patch +++ /dev/null @@ -1,21 +0,0 @@ -From: David Zeuthen <davidz@redhat.com> -Date: Sun, 1 Apr 2007 19:08:52 +0000 (-0400) -Subject: teach fdi.dtd about contains_not, rip out RNG scheme -X-Git-Url: http://gitweb.freedesktop.org/?p=hal.git;a=commitdiff;h=d3aaf33d66443c0f18743a78511caf16df36cb69 - -teach fdi.dtd about contains_not, rip out RNG scheme - -Also add a note to the TODO list that we should have a -hal-fdi-file-validate tool much like desktop-file-validate ---- - ---- a/fdi/fdi.dtd -+++ b/fdi/fdi.dtd -@@ -20,6 +20,7 @@ - is_absolute_path (false|true) #IMPLIED - contains CDATA #IMPLIED - contains_ncase CDATA #IMPLIED -+ contains_not CDATA #IMPLIED - prefix CDATA #IMPLIED - prefix_ncase CDATA #IMPLIED - suffix CDATA #IMPLIED |