projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
dfd272d
)
* luci/libs/sys: fix password authentication for users with disabled password and...
author
Jo-Philipp Wich
<jow@openwrt.org>
Sun, 12 Oct 2008 00:12:21 +0000
(
00:12
+0000)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Sun, 12 Oct 2008 00:12:21 +0000
(
00:12
+0000)
libs/sys/luasrc/sys.lua
patch
|
blob
|
history
diff --git
a/libs/sys/luasrc/sys.lua
b/libs/sys/luasrc/sys.lua
index
0e4a354
..
c271dee
100644
(file)
--- a/
libs/sys/luasrc/sys.lua
+++ b/
libs/sys/luasrc/sys.lua
@@
-35,7
+35,7
@@
luci.util = require "luci.util"
luci.fs = require "luci.fs"
luci.ip = require "luci.ip"
luci.fs = require "luci.fs"
luci.ip = require "luci.ip"
-local tonumber, ipairs, pairs
= tonumber, ipairs, pairs
+local tonumber, ipairs, pairs
, pcall = tonumber, ipairs, pairs, pcall
--- LuCI Linux and POSIX system utilities.
--- LuCI Linux and POSIX system utilities.
@@
-491,8
+491,12
@@
function user.checkpasswd(username, password)
end
end
end
end
- return (pwd == posix.crypt(password, pwd))
+ if pwd and #pwd > 0 and password and #password > 0 then
+ return (pwd == posix.crypt(password, pwd))
+ end
end
end
+
+ return false
end
--- Change the password of given user.
end
--- Change the password of given user.