summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-08-12 01:01:55 +0200
committerLennart Poettering <lennart@poettering.net>2010-08-12 01:01:55 +0200
commit674cdd1933ef5301385d2119a4d1c5e9c862f0a2 (patch)
treeb74b2679e899d01bf1fd26a17397e54626f9023c /src
parent449648c430b38906fd8c8cd9cc3e4a5d05d7e0a9 (diff)
dbus: fix capability serialization
Diffstat (limited to 'src')
-rw-r--r--src/dbus-execute.c6
-rw-r--r--src/dbus-execute.h2
2 files changed, 5 insertions, 3 deletions
diff --git a/src/dbus-execute.c b/src/dbus-execute.c
index 55c61e593f..1222d1bfd2 100644
--- a/src/dbus-execute.c
+++ b/src/dbus-execute.c
@@ -209,11 +209,13 @@ int bus_execute_append_capabilities(Manager *m, DBusMessageIter *i, const char *
else
s = "";
- if (!t)
+ if (!s)
return -ENOMEM;
b = dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &s);
- cap_free(t);
+
+ if (t)
+ cap_free(t);
if (!b)
return -ENOMEM;
diff --git a/src/dbus-execute.h b/src/dbus-execute.h
index a00acbe2f0..cc4b803ca7 100644
--- a/src/dbus-execute.h
+++ b/src/dbus-execute.h
@@ -127,7 +127,7 @@
{ interface, "SyslogPriority", bus_property_append_int, "i", &(context).syslog_priority }, \
{ interface, "SyslogIdentifier", bus_property_append_string, "s", (context).syslog_identifier }, \
{ interface, "SyslogLevelPrefix", bus_property_append_bool, "b", &(context).syslog_level_prefix }, \
- { interface, "Capabilities", bus_execute_append_capabilities, "s", (context).capabilities }, \
+ { interface, "Capabilities", bus_execute_append_capabilities, "s",&(context) }, \
{ interface, "SecureBits", bus_property_append_int, "i", &(context).secure_bits }, \
{ interface, "CapabilityBoundingSetDrop", bus_property_append_uint64, "t", &(context).capability_bounding_set_drop }, \
{ interface, "User", bus_property_append_string, "s", (context).user }, \