[Pkg-utopia-commits] r1132 - in packages/unstable/hal/debian: . patches

Sebastian Dröge slomo-guest at alioth.debian.org
Fri Nov 10 10:44:48 CET 2006


Author: slomo-guest
Date: 2006-11-10 10:44:48 +0100 (Fri, 10 Nov 2006)
New Revision: 1132

Added:
   packages/unstable/hal/debian/patches/25_correctly_free_lists.patch
   packages/unstable/hal/debian/patches/26_fix_hald_not_running_coredump.patch
   packages/unstable/hal/debian/patches/27_dbus_is_error_set.patch
Modified:
   packages/unstable/hal/debian/changelog
Log:
* added some more patches from upstream git


Modified: packages/unstable/hal/debian/changelog
===================================================================
--- packages/unstable/hal/debian/changelog	2006-11-10 09:09:50 UTC (rev 1131)
+++ packages/unstable/hal/debian/changelog	2006-11-10 09:44:48 UTC (rev 1132)
@@ -4,9 +4,20 @@
   * Improve short description of the hal-doc package. (Closes: #387374)
 
   [ Sebastian Dröge ]
-  * debian/patches/24_dbus_connection_close.patch:
-    + Don't call dbus_connection_close() in some hal tools as dbus 0.95 and
-      above abort if this is called when it shouldn't. Patch from upstream GIT
+  * Patches from upstream GIT:
+    + debian/patches/24_dbus_connection_close.patch:
+      - Don't call dbus_connection_close() in lshal and hal-device. This is
+        invalid usage of DBus API.
+        GIT changeset c85e02d58d6503b494bb4c8584a7c44ac6923208
+    + debian/patches/25_correctly_free_lists.patch:
+      - Correctly free lists to prevent accessing free'd memory.
+        GIT changeset a56a15b90177734c70a8b03d961a7bcabdea2af8
+    + debian/patches/26_fix_hald_not_running_coredump.patch:
+      - Don't coredump utilities when hald is not running but print a usefull
+        error message. GIT changeset c2053bf825cd9d81949d63ad83790a68310bb808
+    + debian/patches/27_dbus_is_error_set.patch:
+      - Don't call dbus_error_is_set() with NULL. This is invalid usage of DBus
+        API. GIT changeset 0a9965e4aa4ffc2f382d7fe1286937308439fd1f
 
  -- Sebastian Dröge <slomo at ubuntu.com>  Thu,  9 Nov 2006 23:48:31 +0100
 

Added: packages/unstable/hal/debian/patches/25_correctly_free_lists.patch
===================================================================
--- packages/unstable/hal/debian/patches/25_correctly_free_lists.patch	2006-11-10 09:09:50 UTC (rev 1131)
+++ packages/unstable/hal/debian/patches/25_correctly_free_lists.patch	2006-11-10 09:44:48 UTC (rev 1132)
@@ -0,0 +1,24 @@
+From: John (J5) Palmieri <johnp at redhat.com>
+Date: Mon, 6 Nov 2006 16:48:55 +0000 (-0500)
+Subject: use g_slist_remove_link instead of g_slist_remove
+X-Git-Url: http://gitweb.freedesktop.org/?p=hal.git;a=commitdiff;h=a56a15b90177734c70a8b03d961a7bcabdea2af8
+
+use g_slist_remove_link instead of g_slist_remove
+
+Data would be freed and then g_slist_remove would be called on the
+link which would leave the link in the list, any subsequent iteration
+over the list would cause us to access freed memory.
+---
+
+--- a/hald/hald_dbus.c
++++ b/hald/hald_dbus.c
+@@ -3976,7 +3976,7 @@ local_server_message_handler (DBusConnec
+ 				g_free (hih->introspection_xml);
+ 				g_free (hih->udi);
+ 				g_free (hih);
+-				helper_interface_handlers = g_slist_remove (helper_interface_handlers, i);
++				helper_interface_handlers = g_slist_remove_link (helper_interface_handlers, i);
+ 			}
+ 		}
+ 
+

Added: packages/unstable/hal/debian/patches/26_fix_hald_not_running_coredump.patch
===================================================================
--- packages/unstable/hal/debian/patches/26_fix_hald_not_running_coredump.patch	2006-11-10 09:09:50 UTC (rev 1131)
+++ packages/unstable/hal/debian/patches/26_fix_hald_not_running_coredump.patch	2006-11-10 09:44:48 UTC (rev 1132)
@@ -0,0 +1,122 @@
+From: Artem Kachitchkine <artem.kachitchkin at sun.com>
+Date: Thu, 12 Oct 2006 17:03:08 +0000 (-0700)
+Subject: do not let tools coredump if HAL is not running
+X-Git-Url: http://gitweb.freedesktop.org/?p=hal.git;a=commitdiff;h=c2053bf825cd9d81949d63ad83790a68310bb808
+
+do not let tools coredump if HAL is not running
+
+Make HAL tools actually fail with a useful message
+in case HAL not running on a system.
+---
+
+--- a/tools/hal-device.c
++++ b/tools/hal-device.c
+@@ -136,12 +136,16 @@ int main(int argc, char **argv)
+ 		return 2;
+ 	}
+ 
+-	// fprintf(stderr, "connected to: %s\n", dbus_bus_get_unique_name(conn));
++	/* fprintf(stderr, "connected to: %s\n", dbus_bus_get_unique_name(conn)); */
+ 	if (!(hal_ctx = libhal_ctx_new())) return 3;
+ 	if (!libhal_ctx_set_dbus_connection(hal_ctx, conn)) return 4;
+ 	if (!libhal_ctx_init(hal_ctx, &error)) {
+-		fprintf(stderr, "error: libhal_ctx_init: %s: %s\n", error.name, error.message);
+-		LIBHAL_FREE_DBUS_ERROR (&error);
++		if (dbus_error_is_set(&error)) {
++			fprintf (stderr, "error: libhal_ctx_init: %s: %s\n", error.name, error.message);
++			LIBHAL_FREE_DBUS_ERROR (&error);
++		}
++		fprintf (stderr, "Could not initialise connection to hald.\n"
++				 "Normally this means the HAL daemon (hald) is not running or not ready.\n");
+ 		return 5;
+ 	}
+ 
+--- a/tools/hal_find_by_capability.c
++++ b/tools/hal_find_by_capability.c
+@@ -147,8 +147,12 @@ main (int argc, char *argv[])
+ 		return 1;
+ 	}
+ 	if (!libhal_ctx_init (hal_ctx, &error)) {
+-		fprintf (stderr, "error: libhal_ctx_init: %s: %s\n", error.name, error.message);
+-		LIBHAL_FREE_DBUS_ERROR (&error);
++		if (dbus_error_is_set(&error)) {
++			fprintf (stderr, "error: libhal_ctx_init: %s: %s\n", error.name, error.message);
++			LIBHAL_FREE_DBUS_ERROR (&error);
++		}
++		fprintf (stderr, "Could not initialise connection to hald.\n"
++				 "Normally this means the HAL daemon (hald) is not running or not ready.\n");
+ 		return 1;
+ 	}
+ 
+--- a/tools/hal_find_by_property.c
++++ b/tools/hal_find_by_property.c
+@@ -154,8 +154,12 @@ main (int argc, char *argv[])
+ 		return 1;
+ 	}
+ 	if (!libhal_ctx_init (hal_ctx, &error)) {
+-		fprintf (stderr, "error: libhal_ctx_init: %s: %s\n", error.name, error.message);
+-		LIBHAL_FREE_DBUS_ERROR (&error);
++		if (dbus_error_is_set(&error)) {
++			fprintf (stderr, "error: libhal_ctx_init: %s: %s\n", error.name, error.message);
++			LIBHAL_FREE_DBUS_ERROR (&error);
++		}
++		fprintf (stderr, "Could not initialise connection to hald.\n"
++				 "Normally this means the HAL daemon (hald) is not running or not ready.\n");
+ 		return 1;
+ 	}
+ 
+--- a/tools/hal_get_property.c
++++ b/tools/hal_get_property.c
+@@ -163,8 +163,12 @@ main (int argc, char *argv[])
+ 		return 1;
+ 	}
+ 	if (!libhal_ctx_init (hal_ctx, &error)) {
+-		fprintf (stderr, "error: libhal_ctx_init: %s: %s\n", error.name, error.message);
+-		LIBHAL_FREE_DBUS_ERROR (&error);
++		if (dbus_error_is_set(&error)) {
++			fprintf (stderr, "error: libhal_ctx_init: %s: %s\n", error.name, error.message);
++			LIBHAL_FREE_DBUS_ERROR (&error);
++		}
++		fprintf (stderr, "Could not initialise connection to hald.\n"
++				 "Normally this means the HAL daemon (hald) is not running or not ready.\n");
+ 		return 1;
+ 	}
+ 
+--- a/tools/hal_set_property.c
++++ b/tools/hal_set_property.c
+@@ -230,8 +230,12 @@ main (int argc, char *argv[])
+ 		return 1;
+ 	}
+ 	if (!libhal_ctx_init (hal_ctx, &error)) {
+-		fprintf (stderr, "error: libhal_ctx_init: %s: %s\n", error.name, error.message);
+-		LIBHAL_FREE_DBUS_ERROR (&error);
++		if (dbus_error_is_set(&error)) {
++			fprintf (stderr, "error: libhal_ctx_init: %s: %s\n", error.name, error.message);
++			LIBHAL_FREE_DBUS_ERROR (&error);
++		}
++		fprintf (stderr, "Could not initialise connection to hald.\n"
++				 "Normally this means the HAL daemon (hald) is not running or not ready.\n");
+ 		return 1;
+ 	}
+ 
+--- a/tools/lshal.c
++++ b/tools/lshal.c
+@@ -682,11 +682,12 @@ main (int argc, char *argv[])
+ 		return 1;
+ 	}
+ 	if (!libhal_ctx_init (hal_ctx, &error)) {
+-		fprintf (stderr, "error: libhal_ctx_init: %s: %s\n",
+-			 error.name, error.message);
+-		fprintf (stderr, "Could not initialise connection to hald. \n "
+-				 "Normally this mean the HAL daemon (hald) is not running or not ready.\n");
+-		LIBHAL_FREE_DBUS_ERROR (&error);
++		if (dbus_error_is_set(&error)) {
++			fprintf (stderr, "error: libhal_ctx_init: %s: %s\n", error.name, error.message);
++			LIBHAL_FREE_DBUS_ERROR (&error);
++		}
++		fprintf (stderr, "Could not initialise connection to hald.\n"
++				 "Normally this means the HAL daemon (hald) is not running or not ready.\n");
+ 		return 1;
+ 	}
+ 
+

Added: packages/unstable/hal/debian/patches/27_dbus_is_error_set.patch
===================================================================
--- packages/unstable/hal/debian/patches/27_dbus_is_error_set.patch	2006-11-10 09:09:50 UTC (rev 1131)
+++ packages/unstable/hal/debian/patches/27_dbus_is_error_set.patch	2006-11-10 09:44:48 UTC (rev 1132)
@@ -0,0 +1,82 @@
+From: Danny Kukawka <danny.kukawka at web.de>
+Date: Fri, 13 Oct 2006 09:46:03 +0000 (+0200)
+Subject: replaced LIBHAL_FREE_DBUS_ERROR with dbus_error_free()
+X-Git-Url: http://gitweb.freedesktop.org/?p=hal.git;a=commitdiff;h=0a9965e4aa4ffc2f382d7fe1286937308439fd1f
+
+replaced LIBHAL_FREE_DBUS_ERROR with dbus_error_free()
+
+Replaced _again_ usage of macro LIBHAL_FREE_DBUS_ERROR with
+dbus_error_free().
+
+NOTE: If you use dbus_error_is_set() to check if the error is set,
+      you should not use LIBHAL_FREE_DBUS_ERROR to free the error.
+      Better use dbus_error_free() directly in this case to avoid
+      double call of dbus_error_is_set().
+---
+
+--- a/tools/hal-device.c
++++ b/tools/hal-device.c
+@@ -142,7 +142,7 @@ int main(int argc, char **argv)
+ 	if (!libhal_ctx_init(hal_ctx, &error)) {
+ 		if (dbus_error_is_set(&error)) {
+ 			fprintf (stderr, "error: libhal_ctx_init: %s: %s\n", error.name, error.message);
+-			LIBHAL_FREE_DBUS_ERROR (&error);
++			dbus_error_free (&error);
+ 		}
+ 		fprintf (stderr, "Could not initialise connection to hald.\n"
+ 				 "Normally this means the HAL daemon (hald) is not running or not ready.\n");
+--- a/tools/hal_find_by_property.c
++++ b/tools/hal_find_by_property.c
+@@ -156,7 +156,7 @@ main (int argc, char *argv[])
+ 	if (!libhal_ctx_init (hal_ctx, &error)) {
+ 		if (dbus_error_is_set(&error)) {
+ 			fprintf (stderr, "error: libhal_ctx_init: %s: %s\n", error.name, error.message);
+-			LIBHAL_FREE_DBUS_ERROR (&error);
++			dbus_error_free (&error);
+ 		}
+ 		fprintf (stderr, "Could not initialise connection to hald.\n"
+ 				 "Normally this means the HAL daemon (hald) is not running or not ready.\n");
+@@ -168,7 +168,7 @@ main (int argc, char *argv[])
+ 
+ 	if (dbus_error_is_set (&error)) {
+ 		fprintf (stderr, "error: %s: %s\n", error.name, error.message);
+-		LIBHAL_FREE_DBUS_ERROR (&error);
++		dbus_error_free (&error);
+ 		return 1;
+ 	}
+ 
+--- a/tools/hal_get_property.c
++++ b/tools/hal_get_property.c
+@@ -165,7 +165,7 @@ main (int argc, char *argv[])
+ 	if (!libhal_ctx_init (hal_ctx, &error)) {
+ 		if (dbus_error_is_set(&error)) {
+ 			fprintf (stderr, "error: libhal_ctx_init: %s: %s\n", error.name, error.message);
+-			LIBHAL_FREE_DBUS_ERROR (&error);
++			dbus_error_free (&error);
+ 		}
+ 		fprintf (stderr, "Could not initialise connection to hald.\n"
+ 				 "Normally this means the HAL daemon (hald) is not running or not ready.\n");
+--- a/tools/hal_set_property.c
++++ b/tools/hal_set_property.c
+@@ -232,7 +232,7 @@ main (int argc, char *argv[])
+ 	if (!libhal_ctx_init (hal_ctx, &error)) {
+ 		if (dbus_error_is_set(&error)) {
+ 			fprintf (stderr, "error: libhal_ctx_init: %s: %s\n", error.name, error.message);
+-			LIBHAL_FREE_DBUS_ERROR (&error);
++			dbus_error_free (&error);
+ 		}
+ 		fprintf (stderr, "Could not initialise connection to hald.\n"
+ 				 "Normally this means the HAL daemon (hald) is not running or not ready.\n");
+--- a/tools/lshal.c
++++ b/tools/lshal.c
+@@ -684,7 +684,7 @@ main (int argc, char *argv[])
+ 	if (!libhal_ctx_init (hal_ctx, &error)) {
+ 		if (dbus_error_is_set(&error)) {
+ 			fprintf (stderr, "error: libhal_ctx_init: %s: %s\n", error.name, error.message);
+-			LIBHAL_FREE_DBUS_ERROR (&error);
++			dbus_error_free (&error);
+ 		}
+ 		fprintf (stderr, "Could not initialise connection to hald.\n"
+ 				 "Normally this means the HAL daemon (hald) is not running or not ready.\n");
+
+




More information about the Pkg-utopia-commits mailing list