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
@@ -7,6 +7,7 @@
|
||||
#include <montauk/syscall.h>
|
||||
#include <montauk/string.h>
|
||||
#include <montauk/wifi.h>
|
||||
#include <montauk/capabilities.h>
|
||||
#include <gui/mtk.hpp>
|
||||
#include <gui/mtk/settings.hpp>
|
||||
#include <gui/standalone.hpp>
|
||||
@@ -951,13 +952,10 @@ static void render() {
|
||||
}
|
||||
|
||||
static void launch_dhcp() {
|
||||
montauk::abi::SpawnCapabilities caps{
|
||||
montauk::abi::CAP_NETWORK_ADMIN,
|
||||
montauk::abi::CAP_NETWORK_ADMIN,
|
||||
0
|
||||
};
|
||||
int pid = montauk::spawn_with_caps("0:/os/dhcp.elf", nullptr,
|
||||
nullptr, caps);
|
||||
// The grant table already declares network_admin for dhcp.elf, and this
|
||||
// process is delegable for exactly that, so the lookup reproduces the
|
||||
// mask that used to be spelled out here -- without a second copy to drift.
|
||||
int pid = montauk::caps::launch("0:/os/dhcp.elf");
|
||||
if (pid >= 0) {
|
||||
set_status("DHCP client started");
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user