chiark / gitweb /
dbus: fix capability serialization
authorLennart Poettering <lennart@poettering.net>
Wed, 11 Aug 2010 23:01:55 +0000 (01:01 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 11 Aug 2010 23:01:55 +0000 (01:01 +0200)
src/dbus-execute.c
src/dbus-execute.h

index 55c61e5..1222d1b 100644 (file)
@@ -209,11 +209,13 @@ int bus_execute_append_capabilities(Manager *m, DBusMessageIter *i, const char *
         else
                 s = "";
 
         else
                 s = "";
 
-        if (!t)
+        if (!s)
                 return -ENOMEM;
 
         b = dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &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;
 
         if (!b)
                 return -ENOMEM;
index a00acbe..cc4b803 100644 (file)
         { 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, "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                          }, \
         { 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                          }, \