Fixed authentication bug

This commit is contained in:
Gabriel Pérez-Cerezo 2016-10-08 21:38:14 +02:00
parent 067766eec2
commit d0ad9a4daf
No known key found for this signature in database
GPG Key ID: 90422B01A46D0B3E
1 changed files with 3 additions and 4 deletions

View File

@ -44,11 +44,10 @@ local function read_auth_file()
local fields = line:split(":", true)
local name, password, privilege_string, last_login = unpack(fields)
last_login = tonumber(last_login)
if not (name and password and privilege_string) then
error("Invalid line in auth.txt: "..dump(line))
if (name and password and privilege_string) then
local privileges = core.string_to_privs(privilege_string)
newtable[name] = {password=password, privileges=privileges, last_login=last_login}
end
local privileges = core.string_to_privs(privilege_string)
newtable[name] = {password=password, privileges=privileges, last_login=last_login}
end
end
io.close(file)