summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarinus Schraal <foser@gentoo.org>2005-03-21 21:38:04 +0000
committerMarinus Schraal <foser@gentoo.org>2005-03-21 21:38:04 +0000
commitdf1d6629893ea8fc89f3ded5e4612c5fdc1f961d (patch)
treef9ff405fdbbc2f19000a193b7fe2b48bf5480391 /sys-apps/hal/files
parentAdded ~sparc keyword wrt bug #86127. (diff)
downloadhistorical-df1d6629893ea8fc89f3ded5e4612c5fdc1f961d.tar.gz
historical-df1d6629893ea8fc89f3ded5e4612c5fdc1f961d.tar.bz2
historical-df1d6629893ea8fc89f3ded5e4612c5fdc1f961d.zip
patch it up
Diffstat (limited to 'sys-apps/hal/files')
-rw-r--r--sys-apps/hal/files/digest-hal-0.4.7-r11
-rw-r--r--sys-apps/hal/files/hal-0.4.7-device_info_leak.patch91
-rw-r--r--sys-apps/hal/files/hal-0.4.7-dont_add_device_twice-r1.patch14
3 files changed, 106 insertions, 0 deletions
diff --git a/sys-apps/hal/files/digest-hal-0.4.7-r1 b/sys-apps/hal/files/digest-hal-0.4.7-r1
new file mode 100644
index 000000000000..031b4dff3230
--- /dev/null
+++ b/sys-apps/hal/files/digest-hal-0.4.7-r1
@@ -0,0 +1 @@
+MD5 3386817a6811cce803bcfa8a20b05c51 hal-0.4.7.tar.gz 1349064
diff --git a/sys-apps/hal/files/hal-0.4.7-device_info_leak.patch b/sys-apps/hal/files/hal-0.4.7-device_info_leak.patch
new file mode 100644
index 000000000000..899089e7160d
--- /dev/null
+++ b/sys-apps/hal/files/hal-0.4.7-device_info_leak.patch
@@ -0,0 +1,91 @@
+===================================================================
+RCS file: /cvs/hal/hal/hald/device_info.c,v
+retrieving revision 1.25
+retrieving revision 1.26
+diff -u -r1.25 -r1.26
+--- device_info.c 2005/02/25 01:55:08 1.25
++++ device_info.c 2005/02/28 01:16:47 1.26
+@@ -1218,15 +1218,22 @@
+ XML_Parser parser;
+ ParsingContext *parsing_context;
+
+- snprintf (buf, 511, "%s/%s", dir, filename);
++ file = NULL;
++ filebuf = NULL;
++ parser = NULL;
++ parsing_context = NULL;
++
++ device_matched = FALSE;
++
++ snprintf (buf, sizeof (buf), "%s/%s", dir, filename);
+
+ /*HAL_INFO(("analysing file %s", buf)); */
+
+ /* open file and read it into a buffer; it's a small file... */
+ file = fopen (buf, "r");
+ if (file == NULL) {
+- perror ("fopen");
+- return FALSE;
++ HAL_ERROR (("Could not open file %s", buf));
++ goto out;
+ }
+
+ fseek (file, 0L, SEEK_END);
+@@ -1234,25 +1241,27 @@
+ rewind (file);
+ filebuf = (char *) malloc (filesize);
+ if (filebuf == NULL) {
+- perror ("malloc");
+- fclose (file);
+- return FALSE;
++ HAL_ERROR (("Could not allocate %d bytes for file %s", filesize, buf));
++ goto out;
+ }
+ fread (filebuf, sizeof (char), filesize, file);
+
+-
+- /* ok, now parse the file (should probably reuse parser and say we are
+- * not thread safe
+- */
+- parser = XML_ParserCreate (NULL);
+-
+ /* initialize parsing context */
+ parsing_context =
+ (ParsingContext *) malloc (sizeof (ParsingContext));
+ if (parsing_context == NULL) {
+- perror ("malloc");
+- return FALSE;
++ HAL_ERROR (("Could not allocate parsing context"));
++ goto out;
++ }
++
++ /* TODO: reuse parser
++ */
++ parser = XML_ParserCreate (NULL);
++ if (parser == NULL) {
++ HAL_ERROR (("Could not allocate XML parser"));
++ goto out;
+ }
++
+ parsing_context->depth = 0;
+ parsing_context->device_matched = FALSE;
+ parsing_context->match_ok = TRUE;
+@@ -1287,9 +1296,15 @@
+ device_matched = parsing_context->device_matched;
+ }
+
+- free (filebuf);
+- fclose (file);
+- free (parsing_context);
++out:
++ if (filebuf != NULL)
++ free (filebuf);
++ if (file != NULL)
++ fclose (file);
++ if (parser != NULL)
++ XML_ParserFree (parser);
++ if (parsing_context != NULL)
++ free (parsing_context);
+
+ return device_matched;
+ }
diff --git a/sys-apps/hal/files/hal-0.4.7-dont_add_device_twice-r1.patch b/sys-apps/hal/files/hal-0.4.7-dont_add_device_twice-r1.patch
new file mode 100644
index 000000000000..1a311239f3f9
--- /dev/null
+++ b/sys-apps/hal/files/hal-0.4.7-dont_add_device_twice-r1.patch
@@ -0,0 +1,14 @@
+--- hald/linux/osspec.c 2005-01-23 22:57:01.000000000 +0100
++++ hald/linux/osspec.c 2005-03-14 17:35:19.000000000 +0100
+@@ -1010,6 +1010,11 @@ add_device (const char *given_sysfs_path
+
+ strncpy (sysfs_path, given_sysfs_path, SYSFS_PATH_MAX);
+
++ if (hal_device_store_match_key_value_string (hald_get_gdl (), "linux.sysfs_path", sysfs_path)) {
++ HAL_WARNING (("devpath %s already present in the store, don't add device", sysfs_path));
++ return NULL;
++ }
++
+ len1 = snprintf (buf1, SYSFS_PATH_MAX, "%s/block", sysfs_mount_path);
+ len2 = snprintf (buf2, SYSFS_PATH_MAX, "%s/class", sysfs_mount_path);
+ if (strncmp (sysfs_path, buf1, len1) == 0 || strncmp (sysfs_path, buf2, len2) == 0) {