Hello community, here is the log from the commit of package ivman checked in at Mon Nov 6 22:09:31 CET 2006. -------- --- ivman/ivman.changes 2006-10-05 14:40:16.000000000 +0200 +++ /mounts/work_src_done/STABLE/ivman/ivman.changes 2006-11-06 16:57:25.000000000 +0100 @@ -1,0 +2,5 @@ +Mon Nov 6 16:56:37 CET 2006 - mkoenig@suse.de + +- fix handling of dbus errors + +------------------------------------------------------------------- New: ---- ivman-0.6.12-dbus_error.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ivman.spec ++++++ --- /var/tmp/diff_new_pack.ch8chJ/_old 2006-11-06 22:08:08.000000000 +0100 +++ /var/tmp/diff_new_pack.ch8chJ/_new 2006-11-06 22:08:08.000000000 +0100 @@ -12,15 +12,16 @@ Name: ivman Summary: A Generic Handler for HAL Events -License: GPL +License: GNU General Public License (GPL) - all versions Group: System/Daemons URL: http://ivman.sourceforge.net/ Version: 0.6.12 -Release: 11 +Release: 25 Source0: http://puzzle.dl.sourceforge.net/sourceforge/ivman/%name-%version.tar.bz2 Source1: halmount.py Source2: ivman.init -Patch0: %name-config.patch +Patch0: %{name}-config.patch +Patch1: %{name}-0.6.12-dbus_error.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build Autoreq: on BuildRequires: dbus-1-devel glib2-devel hal-devel libxml2-devel pkgconfig @@ -43,6 +44,7 @@ %prep %setup -q %patch0 +%patch1 -p1 %build CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{_prefix} \ @@ -84,6 +86,8 @@ %_mandir/man8/* %changelog -n ivman +* Mon Nov 06 2006 - mkoenig@suse.de +- fix handling of dbus errors * Thu Oct 05 2006 - mkoenig@suse.de - added eject functionality (from Carl-Daniel Hailfinger) * Thu Sep 28 2006 - mkoenig@suse.de ++++++ ivman-0.6.12-dbus_error.patch ++++++ Index: ivman-0.6.12/src/IvmConfig/IvmConfigCommon.c =================================================================== --- ivman-0.6.12.orig/src/IvmConfig/IvmConfigCommon.c +++ ivman-0.6.12/src/IvmConfig/IvmConfigCommon.c @@ -46,9 +46,13 @@ hal_xml_property_matches(xmlChar const * if (libhal_device_property_exists (hal_ctx, udi, devProperty, &dbus_error)) { - int type = libhal_device_get_property_type(hal_ctx, udi, - devProperty, - &dbus_error); + int type; + + ivm_check_dbus_error(&dbus_error); + type = libhal_device_get_property_type(hal_ctx, udi, + devProperty, + &dbus_error); + ivm_check_dbus_error(&dbus_error); if (type == DBUS_TYPE_STRING) { @@ -56,6 +60,7 @@ hal_xml_property_matches(xmlChar const * (char *) libhal_device_get_property_string(hal_ctx, udi, devProperty, &dbus_error); + ivm_check_dbus_error(&dbus_error); if (!xmlStrcmp(value, (const xmlChar *) propVal)) { @@ -96,7 +101,8 @@ hal_xml_property_matches(xmlChar const * gboolean matches = (libhal_device_get_property_uint64 (hal_ctx, udi, devProperty, &dbus_error) == value_i); - free(devProperty); + ivm_check_dbus_error(&dbus_error); + free(devProperty); return matches; } // unsigned int @@ -108,6 +114,7 @@ hal_xml_property_matches(xmlChar const * gboolean matches = (libhal_device_get_property_int (hal_ctx, udi, devProperty, &dbus_error) == value_i); + ivm_check_dbus_error(&dbus_error); free(devProperty); return matches; } // signed int @@ -149,6 +156,8 @@ gboolean ivm_device_is_mountable(char co if ( !libhal_device_property_exists (hal_ctx, udi, "block.device", &dbus_error)) return FALSE; + ivm_check_dbus_error(&dbus_error); + char *device = (char *) libhal_device_get_property_string(hal_ctx, udi, "block.device", @@ -156,7 +165,7 @@ gboolean ivm_device_is_mountable(char co assert(device); DEBUG(_("UDI %s is device %s"), udi, device, &dbus_error); // if we get here, condition one is satisfied - + ivm_check_dbus_error(&dbus_error); if (!libhal_device_property_exists (hal_ctx, udi, "block.is_volume", &dbus_error)) @@ -180,10 +189,12 @@ is a volume"), device); } // if we get here, condition two is satisfied + ivm_check_dbus_error(&dbus_error); if (!libhal_device_property_exists (hal_ctx, udi, "volume.policy.should_mount", &dbus_error)) { + ivm_check_dbus_error(&dbus_error); if (!libhal_device_property_exists (hal_ctx, udi, "block.storage_device", &dbus_error)) { @@ -194,6 +205,7 @@ is specified"), device); return FALSE; } + ivm_check_dbus_error(&dbus_error); char *new_udi = (char *) libhal_device_get_property_string(hal_ctx, udi, "block.storage_device", @@ -202,11 +214,12 @@ is specified"), device); if (!libhal_device_property_exists (hal_ctx, new_udi, "storage.policy.should_mount", &dbus_error)) { + ivm_check_dbus_error(&dbus_error); // OK, so no storage policy was specified anywhere. Now we'll mount // if parent device is removable. if ( - !libhal_device_property_exists( hal_ctx, new_udi, "storage.removable", &dbus_error ) || - !libhal_device_get_property_bool( hal_ctx, new_udi, "storage.removable", &dbus_error ) + !libhal_device_property_exists( hal_ctx, new_udi, "storage.removable", NULL ) || + !libhal_device_get_property_bool( hal_ctx, new_udi, "storage.removable", NULL ) ) { DEBUG(_("\ Device %s won't be mounted because no mount policy was specified on \ @@ -221,7 +234,7 @@ volume or storage device and storage dev !libhal_device_get_property_bool(hal_ctx, new_udi, "storage.policy.should_mount", - &dbus_error)) + NULL)) { DEBUG(_("\ Device %s won't be mounted because no mount policy was specified on \ @@ -235,7 +248,7 @@ volume and mount policy on parent device else if ( !libhal_device_get_property_bool(hal_ctx, udi, "volume.policy.should_mount", - &dbus_error)) + NULL)) { DEBUG(_("\ Device %s won't be mounted because mount policy on volume says not \ @@ -245,7 +258,7 @@ to mount"), device); } // if we get here, condition three is satisfied - + ivm_check_dbus_error(&dbus_error); /* Sufficient conditions for a volume to _not_ be mountable: (just one of these being true is sufficient) @@ -254,10 +267,10 @@ to mount"), device); 3) volume.is_mounted == true */ if (libhal_device_property_exists - (hal_ctx, udi, "volume.disc.has_data", &dbus_error) + (hal_ctx, udi, "volume.disc.has_data", NULL) && (!libhal_device_get_property_bool(hal_ctx, udi, "volume.disc.has_data", - &dbus_error))) + NULL))) { DEBUG(_("\ Device %s can't be mounted because it is a disc with no data tracks"), device); @@ -269,26 +282,26 @@ Device %s can't be mounted because it is hal_ctx, udi, "block.storage_device", - &dbus_error + NULL ) ) { char *new_udi = (char *) libhal_device_get_property_string( hal_ctx, udi, "block.storage_device", - &dbus_error + NULL ); assert(new_udi); if ( libhal_device_property_exists( hal_ctx, new_udi, "storage.automount_enabled_hint", - &dbus_error + NULL ) && !libhal_device_get_property_bool( hal_ctx, new_udi, "storage.automount_enabled_hint", - &dbus_error + NULL ) ) { DEBUG(_( "Device %s won't be mounted because " @@ -303,10 +316,10 @@ Device %s can't be mounted because it is } if (libhal_device_property_exists - (hal_ctx, udi, "volume.is_mounted", &dbus_error) + (hal_ctx, udi, "volume.is_mounted", NULL) && (libhal_device_get_property_bool(hal_ctx, udi, "volume.is_mounted", - &dbus_error))) + NULL))) { DEBUG(_("\ Won't try to mount device %s, as it is already mounted"), device); Index: ivman-0.6.12/src/manager.c =================================================================== --- ivman-0.6.12.orig/src/manager.c +++ ivman-0.6.12/src/manager.c @@ -650,12 +650,17 @@ gboolean ivm_run_command(char const *con || libhal_device_property_exists(hal_ctx, udi, propertyname, &dbus_error)) { - unsigned int type = execun ? psi_get_property_type(hal_ps, - propertyname) - : libhal_device_get_property_type(hal_ctx, + unsigned int type; + + ivm_check_dbus_error(&dbus_error); + + type = execun ? psi_get_property_type(hal_ps, + propertyname) + : libhal_device_get_property_type(hal_ctx, udi, propertyname, &dbus_error); + ivm_check_dbus_error(&dbus_error); if (type == DBUS_TYPE_STRING) { @@ -811,6 +816,7 @@ gboolean ivm_is_dvd(char const *const ud libhal_device_get_property_string(hal_ctx, udi, "volume.mount_point", &dbus_error); + ivm_check_dbus_error(&dbus_error); if (!libhal_device_property_exists (hal_ctx, udi, "block.device", &dbus_error)) @@ -886,24 +892,31 @@ void ivm_device_mount(char const *const udi, "block.storage_device", &dbus_error ) ) { - + + ivm_check_dbus_error(&dbus_error); + char * parent_udi = libhal_device_get_property_string( hal_ctx, udi, "block.storage_device", &dbus_error); + ivm_check_dbus_error(&dbus_error); + if ( libhal_device_property_exists( hal_ctx, parent_udi, "storage.policy.desired_mount_point", &dbus_error) ) { - + + ivm_check_dbus_error(&dbus_error); + char * mount_point = libhal_device_get_property_string( hal_ctx, parent_udi, "storage.policy.desired_mount_point", &dbus_error); - + ivm_check_dbus_error(&dbus_error); + GString * command = g_string_new( known_mount_command ); int strsize = strlen( "$hal.volume.policy.desired_mount_point$" ); int index = @@ -959,12 +972,12 @@ void ivm_media_changed(char const *const char *device = NULL; if (libhal_device_property_exists - (hal_ctx, udi, "block.device", &dbus_error)) + (hal_ctx, udi, "block.device", NULL)) device = (char *) libhal_device_get_property_string(hal_ctx, udi, - "block.device", &dbus_error); + "block.device", NULL); if (cfg->mount) { @@ -980,10 +993,10 @@ void ivm_media_changed(char const *const if (libhal_device_property_exists(hal_ctx, udi, "volume.is_mounted", - &dbus_error) + NULL) && !libhal_device_get_property_bool(hal_ctx, udi, "volume.is_mounted", - &dbus_error)) + NULL)) { DEBUG(_("Attempting to mount device %s\n"), device); ivm_device_mount(udi); @@ -993,12 +1006,12 @@ void ivm_media_changed(char const *const if ((!libhal_device_property_exists(hal_ctx, udi, "volume.is_mounted", - &dbus_error)) + NULL)) || (!libhal_device_get_property_bool - (hal_ctx, udi, "volume.is_mounted", &dbus_error)) + (hal_ctx, udi, "volume.is_mounted", NULL)) || - (!libhal_device_property_exists(hal_ctx, udi, "volume.mount_point", &dbus_error)) + (!libhal_device_property_exists(hal_ctx, udi, "volume.mount_point", NULL)) ) { DEBUG(_("%s wasn't mounted, by us or by others..."), udi); @@ -1014,7 +1027,7 @@ void ivm_media_changed(char const *const char *mount_point = (char *) libhal_device_get_property_string(hal_ctx, udi, "volume.mount_point", - &dbus_error); + NULL); while (( !mount_point || (strlen(mount_point) < 2) ) && (i < 5)) @@ -1023,7 +1036,7 @@ void ivm_media_changed(char const *const mount_point = (char *) libhal_device_get_property_string(hal_ctx, udi, " volume.mount_point ", - &dbus_error); + NULL); i++; } Index: ivman-0.6.12/src/dbus_interface.c =================================================================== --- ivman-0.6.12.orig/src/dbus_interface.c +++ ivman-0.6.12/src/dbus_interface.c @@ -24,5 +24,6 @@ void ivm_check_dbus_error(const DBusErro { if (dbus_error_is_set(error)) { DEBUG(_("DBus Error! %s: %s"), error->name, error->message); + dbus_error_free(error); } } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org