if (mode < 0)
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Job mode %s is invalid.", smode);
- r = manager_load_unit(m, name, NULL, error, &u);
+ r = selinux_access_check(bus, message, "start", error);
if (r < 0)
return r;
- r = selinux_unit_access_check(u, bus, message, "start", error);
+ r = manager_load_unit(m, name, NULL, error, &u);
if (r < 0)
return r;
r = sd_bus_message_append(
reply, "(usssoo)",
j->id,
- job_state_to_string(j->state),
+ j->unit->id,
job_type_to_string(j->type),
+ job_state_to_string(j->state),
job_path,
unit_path);
if (r < 0)
if (!isempty(init)) {
ri = strdup(init);
if (!ri) {
- free(ri);
+ free(rt);
return -ENOMEM;
}
}
free(m->switch_root_init);
m->switch_root_init = ri;
+ m->exit_code = MANAGER_SWITCH_ROOT;
+
return sd_bus_reply_method_return(message, NULL);
}
for (i = 0; i < n_changes; i++) {
r = sd_bus_message_append(
- message, "(sss)",
+ reply, "(sss)",
unit_file_change_type_to_string(changes[i].type),
changes[i].path,
changes[i].source);
if (r < 0)
goto fail;
- return sd_bus_send(bus, message, NULL);
+ return sd_bus_send(bus, reply, NULL);
fail:
unit_file_changes_free(changes, n_changes);