summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2014-03-06 15:50:42 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2014-03-06 15:50:42 +0000
commit2a078069dcfd01c7bf573d53340c8264c3dc4263 (patch)
treecbfb1b4878e3381867541aa28181357fc1ea69d3
parent03a610591f9c57b58164f3de10d525a67bcccf63 (diff)
downloadgitano-2a078069dcfd01c7bf573d53340c8264c3dc4263.tar.bz2
use passwd.method and passwd.hash instead
-rw-r--r--lib/gitano/usercommand.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/gitano/usercommand.lua b/lib/gitano/usercommand.lua
index 3c8b467..2e4f1b7 100644
--- a/lib/gitano/usercommand.lua
+++ b/lib/gitano/usercommand.lua
@@ -279,22 +279,22 @@ end
local function builtin_passwd_run(conf, _, cmdline, env)
local user = env.GITANO_USER
- local password = sio.stdin:read("*l")
+ local password = sio.stdin:read("*l") or ""
local method, hash = util.hash_password(password)
- if conf.users[user].hash == nil and password == "" then
+ if conf.users[user]["passwd.hash"] == nil and password == "" then
log.chat(string.format("Password for %s is not set and no password was"
.. " provided, no action taken.", user))
return "exit", 0
end
if password ~= "" then
- conf.users[user].method = method
- conf.users[user].hash = hash
+ conf.users[user]["passwd.method"] = method
+ conf.users[user]["passwd.hash"] = hash
else
-- user's password will be removed
- conf.users[user].method = nil
- conf.users[user].hash = nil
+ conf.users[user]["passwd.method"] = nil
+ conf.users[user]["passwd.hash"] = nil
end
local ok, msg