Commit 17f5e457 authored by Harald Hoyer's avatar Harald Hoyer

dbus-manager.c: log error, why switch-root is refused

parent 910003d0
......@@ -1503,8 +1503,11 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
}
/* Safety check */
if (isempty(switch_root_init))
if (isempty(switch_root_init)) {
good = path_is_os_tree(switch_root);
if (!good)
log_error("Not switching root: %s does not seem to be an OS tree. /etc/os-release is missing.", switch_root);
}
else {
_cleanup_free_ char *p = NULL;
......@@ -1513,6 +1516,8 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
goto oom;
good = access(p, X_OK) >= 0;
if (!good)
log_error("Not switching root: cannot execute new init %s", p);
}
if (!good)
return bus_send_error_reply(connection, message, NULL, -EINVAL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment