From: Jo-Philipp Wich Date: Fri, 5 Nov 2010 22:05:11 +0000 (+0000) Subject: libs/sys: fix logic fail in luci.sys.user.checkpasswd() (#152) X-Git-Tag: 0.10.0~524 X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=fcd9579fd49010cff0bda80dd9d8fda1f88c0083 libs/sys: fix logic fail in luci.sys.user.checkpasswd() (#152) --- diff --git a/libs/sys/luasrc/sys.lua b/libs/sys/luasrc/sys.lua index 6d000ae6e..d4242a333 100644 --- a/libs/sys/luasrc/sys.lua +++ b/libs/sys/luasrc/sys.lua @@ -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