util.prosodyctl: Handle os.execute in Lua 5.2 returning true when command terminates...
[prosody.git] / util / prosodyctl.lua
index 207b37630bef299d5be0d1124aeb33c40f27c03e..7c9a3c19dcf7c0edb6ab95959627d197a429cb45 100644 (file)
@@ -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;