summaryrefslogtreecommitdiff
path: root/lib/gitano/usercommand.lua
diff options
context:
space:
mode:
authorDaniel Silverstone <daniel.silverstone@codethink.co.uk>2014-03-10 11:32:04 +0000
committerDaniel Silverstone <daniel.silverstone@codethink.co.uk>2014-03-10 11:32:04 +0000
commit0434ed0c1f14bb856e11925dbf45605f10734449 (patch)
tree9beec6a0fd136924dded9fa3361966b11e83e224 /lib/gitano/usercommand.lua
parent6db67ec2eb252912d0dc1e2bbb1fadcd94be83d4 (diff)
parent2a078069dcfd01c7bf573d53340c8264c3dc4263 (diff)
downloadgitano-0434ed0c1f14bb856e11925dbf45605f10734449.tar.gz
Merge remote-tracking branch 'origin/master' into baserock/morph
Diffstat (limited to 'lib/gitano/usercommand.lua')
-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