forked from Hyperion/HyperionOS
fixed elevate VULN
This commit is contained in:
@@ -236,12 +236,12 @@ local function nextUID()
|
||||
return max + 1
|
||||
end
|
||||
|
||||
function auth.login(username, password)
|
||||
if type(username) ~= "string" or type(password) ~= "string" then
|
||||
function auth.login(uid, password)
|
||||
if type(uid) ~= "number" or type(password) ~= "string" then
|
||||
return nil, "Authentication failure"
|
||||
end
|
||||
|
||||
local entry = getPasswdByUsername(username)
|
||||
local entry = getPasswdByUID(uid)
|
||||
if not entry then
|
||||
-- timing attack resistance
|
||||
hashPassword(password, "aaaaaaaaaaaaaaaa")
|
||||
@@ -619,4 +619,4 @@ if kernel.syscalls then
|
||||
kernel.syscalls["setshell"] = auth.setShell
|
||||
kernel.syscalls["sethomedir"] = auth.setHomedir
|
||||
kernel.syscalls["setgid"] = auth.setGID
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user