projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d30109e
)
libs/sys: fix luci.sys.checkpasswd() semantics
author
Jo-Philipp Wich
<jow@openwrt.org>
Wed, 27 Jun 2012 13:52:09 +0000
(13:52 +0000)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Wed, 27 Jun 2012 13:52:09 +0000
(13:52 +0000)
libs/sys/luasrc/sys.lua
patch
|
blob
|
history
diff --git
a/libs/sys/luasrc/sys.lua
b/libs/sys/luasrc/sys.lua
index 54f7f2b1a97cf858d200c02fed0630f48bacbb0e..18c79119f7f7ebac341e158b3e730ce97fc468b9 100644
(file)
--- a/
libs/sys/luasrc/sys.lua
+++ b/
libs/sys/luasrc/sys.lua
@@
-612,11
+612,10
@@
end
-- @return Boolean indicating wheather the passwords are equal
function user.checkpasswd(username, pass)
local pwh = user.getpasswd(username)
- if pwh and nixio.crypt(pass, pwh) ~= pwh then
- return false
- else
- return true
+ if pwh then
+ return (nixio.crypt(pass, pwh) == pwh)
end
+ return false
end
--- Change the password of given user.