fix: use getuser() syscall for determining username rather than session.toml hack

This commit is contained in:
2026-04-01 11:44:13 +02:00
parent 8e63b75fe7
commit 6276f8b162
8 changed files with 40 additions and 67 deletions
+5 -5
View File
@@ -7,7 +7,6 @@
#include <montauk/syscall.h>
#include <montauk/string.h>
#include <montauk/heap.h>
#include <montauk/config.h>
// ==== ANSI color codes ====
@@ -81,8 +80,11 @@ extern "C" void _start() {
Montauk::SysInfo sysinfo;
montauk::get_info(&sysinfo);
auto doc = montauk::config::load("session");
const char* username = doc.get_string("session.username", "user");
const char* username = "user";
char username_buf[32] = {};
if (montauk::getuser(username_buf, sizeof(username_buf)) > 0 && username_buf[0]) {
username = username_buf;
}
uint64_t ms = montauk::get_milliseconds();
uint64_t total_secs = ms / 1000;
@@ -260,8 +262,6 @@ extern "C" void _start() {
p = app(p, RST);
}
doc.destroy();
// ==== Print output ====
montauk::putchar('\n');