diff options
Diffstat (limited to 'lib/gitano/usercommand.lua')
-rw-r--r-- | lib/gitano/usercommand.lua | 12 |
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 |