fix: fix SYS_GETUSER missing in syscall switch, use getuser in shell username print
This commit is contained in:
@@ -337,6 +337,12 @@ namespace Montauk {
|
|||||||
return Sys_SetTZ((int32_t)frame->arg1);
|
return Sys_SetTZ((int32_t)frame->arg1);
|
||||||
case SYS_GETTZ:
|
case SYS_GETTZ:
|
||||||
return Sys_GetTZ();
|
return Sys_GetTZ();
|
||||||
|
case SYS_SETUSER:
|
||||||
|
if (!ValidUserPtr(frame->arg2)) return -1;
|
||||||
|
return Sys_SetUser((int)frame->arg1, (const char*)frame->arg2);
|
||||||
|
case SYS_GETUSER:
|
||||||
|
if (!ValidUserPtr(frame->arg1)) return -1;
|
||||||
|
return Sys_GetUser((char*)frame->arg1, frame->arg2);
|
||||||
default:
|
default:
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,15 +17,16 @@ char session_home[64] = "";
|
|||||||
// ---- Session info (read once at startup) ----
|
// ---- Session info (read once at startup) ----
|
||||||
|
|
||||||
void read_session() {
|
void read_session() {
|
||||||
auto doc = montauk::config::load("session");
|
// TODO Why is getuser treated as not defined in VSCode intellisense?
|
||||||
const char* name = doc.get_string("session.username", "");
|
|
||||||
if (name[0]) {
|
montauk::getuser(
|
||||||
scopy(session_user, name, sizeof(session_user));
|
(char *)&session_user, // Buffer
|
||||||
|
32 // Buffer max size
|
||||||
|
);
|
||||||
|
|
||||||
scopy(session_home, "0:/users/", sizeof(session_home));
|
scopy(session_home, "0:/users/", sizeof(session_home));
|
||||||
scat(session_home, session_user, sizeof(session_home));
|
scat(session_home, session_user, sizeof(session_home));
|
||||||
}
|
}
|
||||||
doc.destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---- Command history ----
|
// ---- Command history ----
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user