X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fdbus-manager.c;h=747bcfcb9167d617d10c10b5785e2f84e47faa84;hb=81eca919f7cfa88bad8df7d7eac012f367c4c303;hp=742f6bbd8551eae824965606a3c54c40b0fe21a8;hpb=6fa4853328e3d78d092172fa54effb7e785d0a85;p=elogind.git
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
index 742f6bbd8..747bcfcb9 100644
--- a/src/core/dbus-manager.c
+++ b/src/core/dbus-manager.c
@@ -103,32 +103,6 @@
" \n" \
" \n" \
" \n" \
- " \n" \
- " \n" \
- " \n" \
- " \n" \
- " \n" \
- " \n" \
- " \n" \
- " \n" \
- " " \
- " \n" \
- " \n" \
- " \n" \
- " \n" \
- " \n" \
- " \n" \
- " \n" \
- " \n" \
- " \n" \
- " \n" \
- " " \
- " \n" \
- " \n" \
- " \n" \
- " \n" \
- " \n" \
- " \n" \
" \n" \
" \n" \
" \n" \
@@ -236,7 +210,7 @@
" \n" \
" \n" \
" \n" \
- " \n" \
+ " \n" \
" \n" \
" \n" \
" \n" \
@@ -276,7 +250,10 @@
" \n" \
" \n" \
" " \
- " \n"
+ " \n" \
+ " \n" \
+ " \n" \
+ " "
#define BUS_MANAGER_INTERFACE_PROPERTIES_GENERAL \
" \n" \
@@ -294,6 +271,10 @@
" \n" \
" \n" \
" \n" \
+ " \n" \
+ " \n" \
+ " \n" \
+ " \n" \
" \n" \
" \n" \
" \n" \
@@ -313,7 +294,6 @@
" \n" \
" \n" \
" \n" \
- " \n" \
" \n" \
" \n" \
" \n" \
@@ -345,7 +325,7 @@
BUS_GENERIC_INTERFACES_LIST \
"org.freedesktop.systemd1.Manager\0"
-const char bus_manager_interface[] _introspect_("Manager") = BUS_MANAGER_INTERFACE;
+const char bus_manager_interface[] = BUS_MANAGER_INTERFACE;
static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_manager_append_exec_output, exec_output, ExecOutput);
@@ -410,7 +390,7 @@ static int bus_manager_set_log_target(DBusMessageIter *i, const char *property,
}
static int bus_manager_append_log_level(DBusMessageIter *i, const char *property, void *data) {
- char *t;
+ _cleanup_free_ char *t = NULL;
int r;
assert(i);
@@ -423,7 +403,6 @@ static int bus_manager_append_log_level(DBusMessageIter *i, const char *property
if (!dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &t))
r = -ENOMEM;
- free(t);
return r;
}
@@ -491,7 +470,7 @@ static int bus_manager_append_progress(DBusMessageIter *i, const char *property,
static int bus_manager_append_virt(DBusMessageIter *i, const char *property, void *data) {
Manager *m = data;
- const char *id = "";
+ const char *id = NULL;
assert(i);
assert(property);
@@ -499,6 +478,8 @@ static int bus_manager_append_virt(DBusMessageIter *i, const char *property, voi
detect_virtualization(&id);
+ if (!id)
+ id = "";
if (!dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &id))
return -ENOMEM;
@@ -606,6 +587,10 @@ static const BusProperty bus_manager_properties[] = {
{ "UserspaceTimestampMonotonic", bus_property_append_uint64, "t", offsetof(Manager, userspace_timestamp.monotonic) },
{ "FinishTimestamp", bus_property_append_uint64, "t", offsetof(Manager, finish_timestamp.realtime) },
{ "FinishTimestampMonotonic", bus_property_append_uint64, "t", offsetof(Manager, finish_timestamp.monotonic) },
+ { "SecurityStartTimestamp", bus_property_append_uint64, "t", offsetof(Manager, security_start_timestamp.realtime) },
+ { "SecurityStartTimestampMonotonic", bus_property_append_uint64, "t", offsetof(Manager, security_start_timestamp.monotonic) },
+ { "SecurityFinishTimestamp", bus_property_append_uint64, "t", offsetof(Manager, security_finish_timestamp.realtime) },
+ { "SecurityFinishTimestampMonotonic", bus_property_append_uint64, "t", offsetof(Manager, security_finish_timestamp.monotonic) },
{ "GeneratorsStartTimestamp", bus_property_append_uint64, "t", offsetof(Manager, generators_start_timestamp.realtime) },
{ "GeneratorsStartTimestampMonotonic", bus_property_append_uint64, "t", offsetof(Manager, generators_start_timestamp.monotonic) },
{ "GeneratorsFinishTimestamp", bus_property_append_uint64, "t", offsetof(Manager, generators_finish_timestamp.realtime) },
@@ -1188,7 +1173,7 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
goto oom;
} else if (dbus_message_is_method_call(message, "org.freedesktop.DBus.Introspectable", "Introspect")) {
- char *introspection = NULL;
+ _cleanup_free_ char *introspection = NULL;
FILE *f;
Iterator i;
Unit *u;
@@ -1214,7 +1199,7 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
fputs(INTROSPECTION_BEGIN, f);
HASHMAP_FOREACH_KEY(u, k, m->units, i) {
- char *p;
+ _cleanup_free_ char *p = NULL;
if (k != u->id)
continue;
@@ -1222,12 +1207,10 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
p = bus_path_escape(k);
if (!p) {
fclose(f);
- free(introspection);
goto oom;
}
fprintf(f, "", p);
- free(p);
}
HASHMAP_FOREACH(j, m->jobs, i)
@@ -1237,7 +1220,6 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
if (ferror(f)) {
fclose(f);
- free(introspection);
goto oom;
}
@@ -1247,12 +1229,8 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
goto oom;
if (!dbus_message_append_args(reply, DBUS_TYPE_STRING, &introspection, DBUS_TYPE_INVALID)) {
- free(introspection);
goto oom;
}
-
- free(introspection);
-
} else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "Reload")) {
SELINUX_ACCESS_CHECK(connection, message, "reload");
@@ -1429,7 +1407,7 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
_cleanup_strv_free_ char **l = NULL;
char **e = NULL;
- SELINUX_ACCESS_CHECK(connection, message, "reboot");
+ SELINUX_ACCESS_CHECK(connection, message, "reload");
r = bus_parse_strv(message, &l);
if (r == -ENOMEM)
@@ -1456,7 +1434,7 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
_cleanup_strv_free_ char **l = NULL;
char **e = NULL;
- SELINUX_ACCESS_CHECK(connection, message, "reboot");
+ SELINUX_ACCESS_CHECK(connection, message, "reload");
r = bus_parse_strv(message, &l);
if (r == -ENOMEM)
@@ -1484,7 +1462,7 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
char **f = NULL;
DBusMessageIter iter;
- SELINUX_ACCESS_CHECK(connection, message, "reboot");
+ SELINUX_ACCESS_CHECK(connection, message, "reload");
if (!dbus_message_iter_init(message, &iter))
goto oom;