From 2a078069dcfd01c7bf573d53340c8264c3dc4263 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Thu, 6 Mar 2014 15:50:42 +0000 Subject: use passwd.method and passwd.hash instead --- lib/gitano/usercommand.lua | 12 ++++++------ 1 file 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 -- cgit v1.2.1