From dd2437d4af47d7b34734641b68d75fae9051b4b2 Mon Sep 17 00:00:00 2001 From: spsf Date: Sat, 21 Feb 2026 14:12:05 -0600 Subject: [PATCH] fix astro's syscall redefiniton so files use it --- Src/Hyperion-bash/bin/id | 4 ++-- Src/Hyperion-bash/bin/login | 8 ++++---- Src/Hyperion-bash/bin/lsusers | 2 +- Src/Hyperion-bash/bin/passwd | 6 +++--- Src/Hyperion-bash/bin/su | 6 +++--- Src/Hyperion-bash/bin/sudo | 8 ++++---- Src/Hyperion-bash/bin/useradd | 2 +- Src/Hyperion-bash/bin/userdel | 6 +++--- Src/Hyperion-bash/bin/usermod | 16 ++++++++-------- 9 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Src/Hyperion-bash/bin/id b/Src/Hyperion-bash/bin/id index d183dda..bc47188 100644 --- a/Src/Hyperion-bash/bin/id +++ b/Src/Hyperion-bash/bin/id @@ -3,7 +3,7 @@ local args = {...} local uid if args[1] then - uid = syscall.auth_getuid(args[1]) + uid = syscall.getuid(args[1]) if not uid then print("id: user '" .. args[1] .. "' does not exist") syscall.exit(1); return @@ -12,7 +12,7 @@ else uid = syscall.getuid() end -local pwent = syscall.auth_getpasswd(uid) +local pwent = syscall.getpasswd(uid) local name = (pwent and pwent.username) or tostring(uid) local gid = (pwent and pwent.gid) or uid diff --git a/Src/Hyperion-bash/bin/login b/Src/Hyperion-bash/bin/login index 9f65a52..be63256 100644 --- a/Src/Hyperion-bash/bin/login +++ b/Src/Hyperion-bash/bin/login @@ -54,7 +54,7 @@ local function firstBoot() syscall.write(1, "Password too short (minimum 6 characters).\n\n") syscall.devctl(1, "sfgc", 1) else - local ok, err = syscall.auth_setpassword(0, pw1) + local ok, err = syscall.setpassword(0, pw1) if ok then syscall.devctl(1, "sfgc", 3) syscall.write(1, "Root password set.\n\n") @@ -124,10 +124,10 @@ local function doLogin() syscall.write(1, "Password: ") local password = readLine("*") - local ok, err = syscall.auth_login(username, password) + local ok, err = syscall.login(username, password) if ok then - local uid = syscall.auth_getuid(username) - local pwent = uid and syscall.auth_getpasswd(uid) + local uid = syscall.getuid(username) + local pwent = uid and syscall.getpasswd(uid) local shell = (pwent and pwent.shell) or "/bin/hysh" local homedir = (pwent and pwent.homedir) or "/" diff --git a/Src/Hyperion-bash/bin/lsusers b/Src/Hyperion-bash/bin/lsusers index 1685222..29fc90b 100644 --- a/Src/Hyperion-bash/bin/lsusers +++ b/Src/Hyperion-bash/bin/lsusers @@ -1,5 +1,5 @@ --:Minify:-- -local users = syscall.auth_listusers() +local users = syscall.listusers() if not users or #users == 0 then print("No users found.") return diff --git a/Src/Hyperion-bash/bin/passwd b/Src/Hyperion-bash/bin/passwd index 4e03d9f..7f263a1 100644 --- a/Src/Hyperion-bash/bin/passwd +++ b/Src/Hyperion-bash/bin/passwd @@ -9,7 +9,7 @@ local currentUid = syscall.getuid() local targetUid if targetName then - targetUid = syscall.auth_getuid(targetName) + targetUid = syscall.getuid(targetName) if not targetUid then print("passwd: user '" .. targetName .. "' does not exist") syscall.exit(1); return @@ -36,7 +36,7 @@ if currentUid ~= 0 then if #cur > 0 then cur=cur:sub(1,-2); syscall.write(1,"\b \b") end else cur=cur..ch; syscall.write(1,"*") end end - local ok, err = syscall.auth_elevate(targetName, cur) + local ok, err = syscall.elevate(targetName, cur) if not ok then sleep(1) print("passwd: authentication failure") @@ -71,7 +71,7 @@ if pw1 ~= pw2 then syscall.exit(1); return end -local ok, err = syscall.auth_setpassword(targetUid, pw1) +local ok, err = syscall.setpassword(targetUid, pw1) if not ok then print("passwd: " .. tostring(err)) syscall.exit(1); return diff --git a/Src/Hyperion-bash/bin/su b/Src/Hyperion-bash/bin/su index 70d0044..cf98d75 100644 --- a/Src/Hyperion-bash/bin/su +++ b/Src/Hyperion-bash/bin/su @@ -5,7 +5,7 @@ local targetUser = ({ ... })[1] or "root" local currentUid = syscall.getuid() local currentUser = syscall.getUsername(currentUid) or tostring(currentUid) -local targetUid = syscall.auth_getuid(targetUser) +local targetUid = syscall.getuid(targetUser) if not targetUid then print("su: user '" .. targetUser .. "' does not exist") syscall.exit(1) @@ -34,7 +34,7 @@ else end end - ok, err = syscall.auth_elevate(targetUser, pw) + ok, err = syscall.elevate(targetUser, pw) if not ok then sleep(1) print("su: Authentication failure") @@ -47,7 +47,7 @@ if currentUid == 0 then syscall.setuid(targetUid) end -local pwent = syscall.auth_getpasswd(targetUid) +local pwent = syscall.getpasswd(targetUid) local shell = (pwent and pwent.shell) or "/bin/hysh" local homedir = (pwent and pwent.homedir) or "/" diff --git a/Src/Hyperion-bash/bin/sudo b/Src/Hyperion-bash/bin/sudo index c57b6c3..b0ad7fb 100644 --- a/Src/Hyperion-bash/bin/sudo +++ b/Src/Hyperion-bash/bin/sudo @@ -10,7 +10,7 @@ if cmdArgs[i] == "-u" then local uarg = cmdArgs[i] or "root" local numUid = tonumber(uarg) if numUid then - local pwent = syscall.auth_getpasswd(numUid) + local pwent = syscall.getpasswd(numUid) targetUser = (pwent and pwent.username) or uarg else targetUser = uarg @@ -31,7 +31,7 @@ for j = i + 1, #cmdArgs do restArgs[#restArgs + 1] = cmdArgs[j] end local currentUid = syscall.getuid() local currentUser = syscall.getUsername(currentUid) or tostring(currentUid) -local targetUid = syscall.auth_getuid(targetUser) +local targetUid = syscall.getuid(targetUser) if not targetUid then print("sudo: user '" .. targetUser .. "' does not exist") syscall.exit(1) @@ -55,7 +55,7 @@ if currentUid ~= 0 then end end - local ok, err = syscall.auth_elevate(currentUser, pw) + local ok, err = syscall.elevate(currentUser, pw) if not ok then sleep(1) print("sudo: Authentication failure") @@ -97,7 +97,7 @@ if not program then return end -local pwent = syscall.auth_getpasswd(targetUid) +local pwent = syscall.getpasswd(targetUid) if pwent and pwent.homedir then syscall.setEnviron("HOME", pwent.homedir) end diff --git a/Src/Hyperion-bash/bin/useradd b/Src/Hyperion-bash/bin/useradd index 2baf4f2..b1069b7 100644 --- a/Src/Hyperion-bash/bin/useradd +++ b/Src/Hyperion-bash/bin/useradd @@ -48,7 +48,7 @@ if not password then end end -local uid, err = syscall.auth_newuser( +local uid, err = syscall.newuser( opt.username, password, opt.gid, opt.homedir, opt.shell or "/bin/hysh" ) if not uid then diff --git a/Src/Hyperion-bash/bin/userdel b/Src/Hyperion-bash/bin/userdel index 701c869..8f4e798 100644 --- a/Src/Hyperion-bash/bin/userdel +++ b/Src/Hyperion-bash/bin/userdel @@ -14,15 +14,15 @@ if not username then syscall.exit(1); return end -local uid = syscall.auth_getuid(username) +local uid = syscall.getuid(username) if not uid then print("userdel: user '" .. username .. "' does not exist") syscall.exit(1); return end -local pwent = syscall.auth_getpasswd(uid) +local pwent = syscall.getpasswd(uid) -local ok, err = syscall.auth_deleteuser(uid) +local ok, err = syscall.deleteuser(uid) if not ok then print("userdel: " .. tostring(err)) syscall.exit(1); return diff --git a/Src/Hyperion-bash/bin/usermod b/Src/Hyperion-bash/bin/usermod index f053cb7..506db02 100644 --- a/Src/Hyperion-bash/bin/usermod +++ b/Src/Hyperion-bash/bin/usermod @@ -27,7 +27,7 @@ if opt.lock and opt.unlock then syscall.exit(1); return end -local uid = syscall.auth_getuid(opt.username) +local uid = syscall.getuid(opt.username) if not uid then print("usermod: user '" .. opt.username .. "' does not exist") syscall.exit(1); return @@ -38,12 +38,12 @@ local function apply(fn, ...) if not ok then print("usermod: " .. tostring(err)); syscall.exit(1) end end -if opt.newname then apply(syscall.auth_setusername, uid, opt.newname) end -if opt.password then apply(syscall.auth_setpassword, uid, opt.password) end -if opt.gid then apply(syscall.auth_setgid, uid, opt.gid) end -if opt.homedir then apply(syscall.auth_sethomedir, uid, opt.homedir) end -if opt.shell then apply(syscall.auth_setshell, uid, opt.shell) end -if opt.lock then apply(syscall.auth_lockuser, uid) end -if opt.unlock then apply(syscall.auth_unlockuser, uid) end +if opt.newname then apply(syscall.setusername, uid, opt.newname) end +if opt.password then apply(syscall.setpassword, uid, opt.password) end +if opt.gid then apply(syscall.setgid, uid, opt.gid) end +if opt.homedir then apply(syscall.sethomedir, uid, opt.homedir) end +if opt.shell then apply(syscall.setshell, uid, opt.shell) end +if opt.lock then apply(syscall.lockuser, uid) end +if opt.unlock then apply(syscall.unlockuser, uid) end print("usermod: updated user '" .. opt.username .. "'")