summaryrefslogtreecommitdiff
path: root/hald/device.c
diff options
context:
space:
mode:
authorDavid Zeuthen <david@fubar.dk>2006-01-21 06:36:51 +0000
committerDavid Zeuthen <david@fubar.dk>2006-01-21 06:36:51 +0000
commitbfedd37313404ae88f738354161b430b55f73e0c (patch)
tree3c7d00be405010f9959b58f8d8157720921feb27 /hald/device.c
parent3ded9af388a9b6102b70593c277dc96b987a1289 (diff)
downloadhal-bfedd37313404ae88f738354161b430b55f73e0c.tar.gz
Search $PATH before searching allowed dirs; this is needed to make e.g.
run-hald.sh work - note that passing "/bin/sh /path/to/evil/program" will _not_ work as we don't do shell-ish stuff. Also, don't force working dir to be "/" for same reasons. Export hal_property_strlist_clear New function Pass $PATH to runner Fix up indenting New function (start): Check for new fdi tag "clear" Export hal_device_property_strlist_clear New function
Diffstat (limited to 'hald/device.c')
-rw-r--r--hald/device.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/hald/device.c b/hald/device.c
index e1e56c6d..eca5a7a0 100644
--- a/hald/device.c
+++ b/hald/device.c
@@ -1200,6 +1200,39 @@ hal_device_property_strlist_remove_elem (HalDevice *device,
}
gboolean
+hal_device_property_strlist_clear (HalDevice *device,
+ const char *key)
+{
+ HalProperty *prop;
+
+ /* check if property already exists */
+ prop = hal_device_property_find (device, key);
+
+ if (prop == NULL) {
+ prop = hal_property_new_strlist (key);
+
+ device->properties = g_slist_prepend (device->properties, prop);
+
+ g_signal_emit (device, signals[PROPERTY_CHANGED], 0,
+ key, FALSE, TRUE);
+
+ return TRUE;
+ }
+
+ if (hal_property_get_type (prop) != HAL_PROPERTY_TYPE_STRLIST)
+ return FALSE;
+
+ if (hal_property_strlist_clear (prop)) {
+ g_signal_emit (device, signals[PROPERTY_CHANGED], 0,
+ key, FALSE, FALSE);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+
+gboolean
hal_device_property_strlist_add (HalDevice *device,
const char *key,
const char *value)