forked from Hyperion/HyperionOS
load vuln fixed, sudo fixed
This commit is contained in:
@@ -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.getuid(targetUser)
|
||||
local targetUid = syscall.getuidbyname(targetUser)
|
||||
if not targetUid then
|
||||
print("sudo: user '" .. targetUser .. "' does not exist")
|
||||
syscall.exit(1)
|
||||
@@ -39,7 +39,7 @@ if not targetUid then
|
||||
end
|
||||
|
||||
if currentUid ~= 0 then
|
||||
printInline("[sudo] password for " .. currentUser .. ": ")
|
||||
printInline("[sudo] password for root: ")
|
||||
local pw = ""
|
||||
while true do
|
||||
local ch = syscall.read(0)
|
||||
@@ -55,7 +55,7 @@ if currentUid ~= 0 then
|
||||
end
|
||||
end
|
||||
|
||||
local ok, err = syscall.elevate(currentUser, pw)
|
||||
local ok, err = syscall.elevate("root", pw)
|
||||
if not ok then
|
||||
sleep(1)
|
||||
print("sudo: Authentication failure")
|
||||
@@ -63,7 +63,7 @@ if currentUid ~= 0 then
|
||||
return
|
||||
end
|
||||
|
||||
if targetUid ~= 0 then
|
||||
if targetUid ~= currentUid then
|
||||
syscall.setuid(targetUid)
|
||||
end
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user