summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/spec/hal-spec-properties.xml59
-rw-r--r--hald/freebsd/hf-computer.c11
-rw-r--r--hald/linux/coldplug.c2
-rw-r--r--hald/linux/osspec.c11
-rw-r--r--hald/solaris/devinfo_misc.c11
-rw-r--r--tools/hal-storage-mount.c14
6 files changed, 100 insertions, 8 deletions
diff --git a/doc/spec/hal-spec-properties.xml b/doc/spec/hal-spec-properties.xml
index db7abee2..69413542 100644
--- a/doc/spec/hal-spec-properties.xml
+++ b/doc/spec/hal-spec-properties.xml
@@ -12,6 +12,64 @@
can catch.
</para>
+ <sect1 id="device-properties-hal">
+ <title>
+ org.freedesktop.Hal namespace
+ </title>
+ <para>
+ The <literal>org.freedesktop.Hal</literal> namespace contain properties that
+ can be considered metadata about HAL itself and not about device objects. They
+ are only available at the root object (<literal>/org/freedesktop/Hal/devices/computer</literal>)
+ and allow to query information about HAL from fdi files.
+ </para>
+ <informaltable>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Key (type)</entry>
+ <entry>Values</entry>
+ <entry>Mandatory</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>
+ <literal>org.freedesktop.Hal.version</literal> (string)
+ </entry>
+ <entry>example: 0.5.13</entry>
+ <entry>Yes</entry>
+ <entry>The version number of the running HAL daemon.</entry>
+ </row>
+ <row>
+ <entry>
+ <literal>org.freedesktop.Hal.version.major</literal> (int)
+ </entry>
+ <entry>example: 0</entry>
+ <entry>Yes</entry>
+ <entry>The major version number of the running HAL daemon.</entry>
+ </row>
+ <row>
+ <entry>
+ <literal>org.freedesktop.Hal.version.minor</literal> (int)
+ </entry>
+ <entry>example: 5</entry>
+ <entry>Yes</entry>
+ <entry>The minor version number of the running HAL daemon.</entry>
+ </row>
+ <row>
+ <entry>
+ <literal>org.freedesktop.Hal.version.micro</literal> (int)
+ </entry>
+ <entry>example: 13</entry>
+ <entry>Yes</entry>
+ <entry>The micro version number of the running HAL daemon.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </sect1>
+
<sect1 id="properties-general">
<title>General Properties</title>
<para>
@@ -19,6 +77,7 @@
physical or functional characteristics of what the device
object represents.
</para>
+
<sect2 id="device-properties-info">
<title>
info namespace
diff --git a/hald/freebsd/hf-computer.c b/hald/freebsd/hf-computer.c
index 9e7aac48..7e9b9de1 100644
--- a/hald/freebsd/hf-computer.c
+++ b/hald/freebsd/hf-computer.c
@@ -130,6 +130,17 @@ hf_computer_device_add (void)
hal_device_property_set_string(device, "info.subsystem", "unknown");
hal_device_property_set_string(device, "info.product", "Computer");
+ if (PACKAGE_VERSION) {
+ int major, minor, micro;
+
+ hal_device_property_set_string (root, "org.freedesktop.Hal.version", PACKAGE_VERSION);
+ if ( sscanf( PACKAGE_VERSION, "%d.%d.%d", &major, &minor, &micro ) == 3 ) {
+ hal_device_property_set_int (root, "org.freedesktop.Hal.version.major", major);
+ hal_device_property_set_int (root, "org.freedesktop.Hal.version.minor", minor);
+ hal_device_property_set_int (root, "org.freedesktop.Hal.version.micro", micro);
+ }
+ }
+
if (uname(&un) == 0)
{
hal_device_property_set_string(device, "system.kernel.name", un.sysname);
diff --git a/hald/linux/coldplug.c b/hald/linux/coldplug.c
index 276382d8..5f5b4f71 100644
--- a/hald/linux/coldplug.c
+++ b/hald/linux/coldplug.c
@@ -256,7 +256,7 @@ hal_util_init_sysfs_to_udev_map (void)
} else if (strncmp(line, "E: ID_FS_LABEL_ENC=", 19) == 0) {
len = strlen (&line[15]);
info->fslabel = g_malloc0 (len + 1);
- hal_util_decode_escape (&line[19], info->fslabel, len + 1);
+ hal_util_decode_escape (&line[19], (char *)info->fslabel, len + 1);
}
}
diff --git a/hald/linux/osspec.c b/hald/linux/osspec.c
index f721b987..998ae79f 100644
--- a/hald/linux/osspec.c
+++ b/hald/linux/osspec.c
@@ -841,6 +841,17 @@ osspec_probe (void)
hal_device_property_set_string (root, "info.product", "Computer");
hal_device_set_udi (root, "/org/freedesktop/Hal/devices/computer");
+ if (PACKAGE_VERSION) {
+ int major, minor, micro;
+
+ hal_device_property_set_string (root, "org.freedesktop.Hal.version", PACKAGE_VERSION);
+ if ( sscanf( PACKAGE_VERSION, "%d.%d.%d", &major, &minor, &micro ) == 3 ) {
+ hal_device_property_set_int (root, "org.freedesktop.Hal.version.major", major);
+ hal_device_property_set_int (root, "org.freedesktop.Hal.version.minor", minor);
+ hal_device_property_set_int (root, "org.freedesktop.Hal.version.micro", micro);
+ }
+ }
+
if (uname (&un) >= 0) {
hal_device_property_set_string (root, "system.kernel.name", un.sysname);
hal_device_property_set_string (root, "system.kernel.version", un.release);
diff --git a/hald/solaris/devinfo_misc.c b/hald/solaris/devinfo_misc.c
index dafffd26..5f6daee2 100644
--- a/hald/solaris/devinfo_misc.c
+++ b/hald/solaris/devinfo_misc.c
@@ -74,6 +74,17 @@ devinfo_computer_add(HalDevice *parent, di_node_t node, char *devfs_path, char *
hal_device_set_udi (d, "/org/freedesktop/Hal/devices/computer");
hal_device_property_set_string (d, "solaris.devfs_path", devfs_path);
+ if (PACKAGE_VERSION) {
+ int major, minor, micro;
+
+ hal_device_property_set_string (root, "org.freedesktop.Hal.version", PACKAGE_VERSION);
+ if ( sscanf( PACKAGE_VERSION, "%d.%d.%d", &major, &minor, &micro ) == 3 ) {
+ hal_device_property_set_int (root, "org.freedesktop.Hal.version.major", major);
+ hal_device_property_set_int (root, "org.freedesktop.Hal.version.minor", minor);
+ hal_device_property_set_int (root, "org.freedesktop.Hal.version.micro", micro);
+ }
+ }
+
if (uname (&un) >= 0) {
hal_device_property_set_string (d, "system.kernel.name", un.sysname);
hal_device_property_set_string (d, "system.kernel.version", un.release);
diff --git a/tools/hal-storage-mount.c b/tools/hal-storage-mount.c
index 78e01603..9471706c 100644
--- a/tools/hal-storage-mount.c
+++ b/tools/hal-storage-mount.c
@@ -786,13 +786,13 @@ handle_mount (LibHalContext *hal_ctx,
/* don't consider uid= on vfat, iso9660, hfs and udf change-uid for the purpose of policy
* (since these doesn't contain uid/gid bits)
*/
- if (libhal_volume_get_fstype (volume) != NULL &&
- strcmp (libhal_volume_get_fstype (volume), "vfat") != 0 &&
- strcmp (libhal_volume_get_fstype (volume), "ntfs") != 0 &&
- strcmp (libhal_volume_get_fstype (volume), "ntfs-3g") != 0 &&
- strcmp (libhal_volume_get_fstype (volume), "iso9660") != 0 &&
- strcmp (libhal_volume_get_fstype (volume), "hfs") != 0 &&
- strcmp (libhal_volume_get_fstype (volume), "udf") != 0) {
+ const char *v_fstype;
+
+ v_fstype = libhal_volume_get_fstype (volume);
+ if (v_fstype != NULL &&
+ strcmp (v_fstype, "vfat") != 0 && strcmp (v_fstype, "ntfs") != 0 &&
+ strcmp (v_fstype, "ntfs-3g") != 0 && strcmp (v_fstype, "iso9660") != 0 &&
+ strcmp (v_fstype, "hfs") != 0 && strcmp (v_fstype, "udf") != 0) {
pol_change_uid = wants_to_change_uid;
}
}