chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
loopback-setup: correctly set flags and scope for ipv6 address
[elogind.git]
/
src
/
libsystemd-bus
/
bus-objects.c
diff --git
a/src/libsystemd-bus/bus-objects.c
b/src/libsystemd-bus/bus-objects.c
index 8ffda2f95db0f6ecef8be40e70761d14d2e2aeb6..54ed7542d27473dce8222e4af3191d390a5fd151 100644
(file)
--- a/
src/libsystemd-bus/bus-objects.c
+++ b/
src/libsystemd-bus/bus-objects.c
@@
-51,7
+51,7
@@
static int node_vtable_get_userdata(
if (r < 0)
return r;
if (sd_bus_error_is_set(error))
if (r < 0)
return r;
if (sd_bus_error_is_set(error))
- return sd_bus_error_get_errno(error);
+ return
-
sd_bus_error_get_errno(error);
if (r == 0)
return r;
}
if (r == 0)
return r;
}
@@
-117,7
+117,7
@@
static int add_enumerated_to_set(
if (r < 0)
return r;
if (sd_bus_error_is_set(error))
if (r < 0)
return r;
if (sd_bus_error_is_set(error))
- return sd_bus_error_get_errno(error);
+ return
-
sd_bus_error_get_errno(error);
STRV_FOREACH(k, children) {
if (r < 0) {
STRV_FOREACH(k, children) {
if (r < 0) {
@@
-419,7
+419,7
@@
static int invoke_property_get(
if (r < 0)
return r;
if (sd_bus_error_is_set(error))
if (r < 0)
return r;
if (sd_bus_error_is_set(error))
- return sd_bus_error_get_errno(error);
+ return
-
sd_bus_error_get_errno(error);
return r;
}
return r;
}
@@
-475,7
+475,7
@@
static int invoke_property_set(
if (r < 0)
return r;
if (sd_bus_error_is_set(error))
if (r < 0)
return r;
if (sd_bus_error_is_set(error))
- return sd_bus_error_get_errno(error);
+ return
-
sd_bus_error_get_errno(error);
return r;
}
return r;
}
@@
-1284,6
+1284,10
@@
int bus_process_object(sd_bus *bus, sd_bus_message *m) {
if (hashmap_isempty(bus->nodes))
return 0;
if (hashmap_isempty(bus->nodes))
return 0;
+ /* Never respond to broadcast messages */
+ if (bus->bus_client && !m->destination)
+ return 0;
+
assert(m->path);
assert(m->member);
assert(m->path);
assert(m->member);
@@
-1334,7
+1338,8
@@
int bus_process_object(sd_bus *bus, sd_bus_message *m) {
static struct node *bus_node_allocate(sd_bus *bus, const char *path) {
struct node *n, *parent;
const char *e;
static struct node *bus_node_allocate(sd_bus *bus, const char *path) {
struct node *n, *parent;
const char *e;
- char *s, *p;
+ _cleanup_free_ char *s = NULL;
+ char *p;
int r;
assert(bus);
int r;
assert(bus);
@@
-1362,10
+1367,8
@@
static struct node *bus_node_allocate(sd_bus *bus, const char *path) {
p = strndupa(path, MAX(1, path - e));
parent = bus_node_allocate(bus, p);
p = strndupa(path, MAX(1, path - e));
parent = bus_node_allocate(bus, p);
- if (!parent) {
- free(s);
+ if (!parent)
return NULL;
return NULL;
- }
}
n = new0(struct node, 1);
}
n = new0(struct node, 1);
@@
-1374,10
+1377,11
@@
static struct node *bus_node_allocate(sd_bus *bus, const char *path) {
n->parent = parent;
n->path = s;
n->parent = parent;
n->path = s;
+ s = NULL; /* do not free */
- r = hashmap_put(bus->nodes,
s
, n);
+ r = hashmap_put(bus->nodes,
n->path
, n);
if (r < 0) {
if (r < 0) {
- free(
s
);
+ free(
n->path
);
free(n);
return NULL;
}
free(n);
return NULL;
}