summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-11-05 21:24:33 +0100
committerLennart Poettering <lennart@poettering.net>2013-11-05 21:24:33 +0100
commit5d66866d96ca7b85b36df99651991b2a1acd2b2e (patch)
tree9c3a937b9a9b108145ba5763a55a1a5deab76dbe /src
parentce6d4630c1e52ab4f08fbf96b82ffdfa3c6e24ee (diff)
bus: never report nodes as children that do not have the right prefix
Diffstat (limited to 'src')
-rw-r--r--src/libsystemd-bus/bus-objects.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/libsystemd-bus/bus-objects.c b/src/libsystemd-bus/bus-objects.c
index 92781e9adc..93bd3ad86c 100644
--- a/src/libsystemd-bus/bus-objects.c
+++ b/src/libsystemd-bus/bus-objects.c
@@ -114,12 +114,17 @@ static int add_enumerated_to_set(
continue;
}
- if (!object_path_is_valid(*k) && object_path_startswith(*k, prefix)) {
+ if (!object_path_is_valid(*k)){
free(*k);
r = -EINVAL;
continue;
}
+ if (!object_path_startswith(*k, prefix)) {
+ free(*k);
+ continue;
+ }
+
r = set_consume(s, *k);
}
@@ -154,6 +159,9 @@ static int add_subtree_to_set(
LIST_FOREACH(siblings, i, n->child) {
char *t;
+ if (!object_path_startswith(i->path, prefix))
+ continue;
+
t = strdup(i->path);
if (!t)
return -ENOMEM;