From fcd9579fd49010cff0bda80dd9d8fda1f88c0083 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 5 Nov 2010 22:05:11 +0000 Subject: libs/sys: fix logic fail in luci.sys.user.checkpasswd() (#152) --- libs/sys/luasrc/sys.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libs/sys/luasrc') 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 -- cgit v1.2.3