libs/sys: fix logic fail in luci.sys.user.checkpasswd() (#152)

This commit is contained in:
Jo-Philipp Wich 2010-11-05 22:05:11 +00:00
parent 19cae04003
commit fcd9579fd4

View file

@ -604,7 +604,7 @@ end
-- @return Boolean indicating wheather the passwords are equal
function user.checkpasswd(username, pass)
local pwh = user.getpasswd(username)
if not pwh or nixio.crypt(pass, pwh) ~= pwh then
if pwh and nixio.crypt(pass, pwh) ~= pwh then
return false
else
return true