refactor: capabilities - add unified launch routine
This commit is contained in:
1 parent
638dd9ee06
commit
5b90869101
9 files changed
+78
-61
No files matched your search
@@ -83,9 +83,7 @@ static bool run_service(const char* path, const char* name, bool wait = true) {
|
||||
|
||||
// Grants are keyed on the executable, not the service id, so repointing a
|
||||
// privileged entry in init.toml at another program transfers no authority.
|
||||
montauk::abi::SpawnCapabilities caps =
|
||||
montauk::caps::for_binary(path, montauk::caps::self_delegable());
|
||||
int pid = montauk::spawn_with_caps(path, nullptr, "system", caps);
|
||||
int pid = montauk::caps::launch(path, {.user = "system"});
|
||||
if (pid < 0) {
|
||||
snprintf(msg, sizeof(msg), "Failed to start %s", name);
|
||||
log_err(msg);
|
||||
|
||||
Reference in new issue
Block a user