Merge 0.10->trunk
[prosody.git] / util / prosodyctl.lua
index f8f2864412d48bd83dfd60b69c806e9cb287bfc5..7c9a3c19dcf7c0edb6ab95959627d197a429cb45 100644 (file)
@@ -22,7 +22,7 @@ local nodeprep, nameprep = stringprep.nodeprep, stringprep.nameprep;
 
 local io, os = io, os;
 local print = print;
-local tostring, tonumber = tostring, tonumber;
+local tonumber = tonumber;
 
 local CFG_SOURCEDIR = _G.CFG_SOURCEDIR;
 
@@ -44,7 +44,7 @@ end
 local function getchar(n)
        local stty_ret = os.execute("stty raw -echo 2>/dev/null");
        local ok, char;
-       if stty_ret == 0 then
+       if stty_ret == true or stty_ret == 0 then
                ok, char = pcall(io.read, n or 1);
                os.execute("stty sane");
        else
@@ -149,7 +149,7 @@ local function adduser(params)
 end
 
 local function user_exists(params)
-       local user, host, password = nodeprep(params.user), nameprep(params.host), params.password;
+       local user, host = nodeprep(params.user), nameprep(params.host);
 
        storagemanager.initialize_host(host);
        local provider = prosody.hosts[host].users;