Changeset 8792

Show
Ignore:
Timestamp:
06/27/12 14:52:09 (12 months ago)
Author:
jow
Message:

libs/sys: fix luci.sys.checkpasswd() semantics

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • luci/trunk/libs/sys/luasrc/sys.lua

    r8673 r8792  
    613613function user.checkpasswd(username, pass) 
    614614    local pwh = user.getpasswd(username) 
    615     if pwh and nixio.crypt(pass, pwh) ~= pwh then 
    616         return false 
    617     else 
    618         return true 
    619     end 
     615    if pwh then 
     616        return (nixio.crypt(pass, pwh) == pwh) 
     617    end 
     618    return false 
    620619end 
    621620