summaryrefslogtreecommitdiffstats
path: root/source/l/hal/patches/check_udi_properly.diff
diff options
context:
space:
mode:
author Patrick J Volkerding <volkerdi@slackware.com>2009-08-26 10:00:38 -0500
committer Eric Hameleers <alien@slackware.com>2018-05-31 22:41:17 +0200
commit5a12e7c134274dba706667107d10d231517d3e05 (patch)
tree55718d5acb710fde798d9f38d0bbaf594ed4b296 /source/l/hal/patches/check_udi_properly.diff
downloadcurrent-5a12e7c134274dba706667107d10d231517d3e05.tar.gz
current-5a12e7c134274dba706667107d10d231517d3e05.tar.xz
Slackware 13.0slackware-13.0
Wed Aug 26 10:00:38 CDT 2009 Slackware 13.0 x86_64 is released as stable! Thanks to everyone who helped make this release possible -- see the RELEASE_NOTES for the credits. The ISOs are off to the replicator. This time it will be a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD. We're taking pre-orders now at store.slackware.com. Please consider picking up a copy to help support the project. Once again, thanks to the entire Slackware community for all the help testing and fixing things and offering suggestions during this development cycle. As always, have fun and enjoy! -P.
Diffstat (limited to 'source/l/hal/patches/check_udi_properly.diff')
-rw-r--r--source/l/hal/patches/check_udi_properly.diff41
1 files changed, 41 insertions, 0 deletions
diff --git a/source/l/hal/patches/check_udi_properly.diff b/source/l/hal/patches/check_udi_properly.diff
new file mode 100644
index 000000000..cd474abc5
--- /dev/null
+++ b/source/l/hal/patches/check_udi_properly.diff
@@ -0,0 +1,41 @@
+Author: Richard Hughes <richard@hughsie.com>
+Date: Thu Jan 29 08:33:00 2009 +0000
+
+ check udi in hal-get-property
+
+ We are not checking if a UDI is valid in hal-get-property
+ which means getting a horrible DBUS error if the entry
+ is not a valid DBUS path.
+
+diff --git a/tools/hal_get_property.c b/tools/hal_get_property.c
+index ecaa6ce..d31261a 100644
+--- a/tools/hal_get_property.c
++++ b/tools/hal_get_property.c
+@@ -84,6 +84,7 @@ main (int argc, char *argv[])
+ dbus_bool_t is_hex = FALSE;
+ dbus_bool_t is_verbose = FALSE;
+ dbus_bool_t is_version = FALSE;
++ dbus_bool_t udi_exists;
+ char *str;
+ DBusError error;
+
+@@ -168,6 +169,19 @@ main (int argc, char *argv[])
+ return 1;
+ }
+
++ /* check UDI exists */
++ udi_exists = libhal_device_exists (hal_ctx, udi, &error);
++ if (!udi_exists) {
++ fprintf (stderr, "error: UDI %s does not exist\n", udi);
++ return 1;
++ }
++ if (dbus_error_is_set(&error)) {
++ fprintf (stderr, "error: libhal_device_exists: %s: %s\n", error.name, error.message);
++ LIBHAL_FREE_DBUS_ERROR (&error);
++ return 1;
++ }
++
++ /* get type */
+ type = libhal_device_get_property_type (hal_ctx, udi, key, &error);
+ if (type == LIBHAL_PROPERTY_TYPE_INVALID) {
+ fprintf (stderr, "error: libhal_device_get_property_type: %s: %s\n", error.name, error.message);