aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-05-05 16:41:17 +0100
committerMatthew Wild <mwild1@gmail.com>2009-05-05 16:41:17 +0100
commitfe72a49ae5a2187b69b75159a0a5adfc15c2c8bf (patch)
tree383f8492299cbf861436b4f3b002fcd155e04ad1
parentf2fd8fa91e4c8f9d92d9c3c1c503d07ff1f243d7 (diff)
parentceb73bd4358e9dd286cc5757112254606dda7d54 (diff)
downloadprosody-fe72a49ae5a2187b69b75159a0a5adfc15c2c8bf.tar.gz
prosody-fe72a49ae5a2187b69b75159a0a5adfc15c2c8bf.zip
Merge with 0.4
-rwxr-xr-xprosodyctl8
-rw-r--r--util/prosodyctl.lua5
2 files changed, 9 insertions, 4 deletions
diff --git a/prosodyctl b/prosodyctl
index 0709bcb9..91ed7432 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -92,6 +92,7 @@ local error_messages = setmetatable({
["invalid-hostname"] = "The given hostname is invalid";
["no-password"] = "No password was supplied";
["no-such-user"] = "The given user does not exist on the server";
+ ["unable-to-save-data"] = "Unable to store, perhaps you don't have permission?";
}, { __index = function (t,k) return "Error: "..(tostring(k):gsub("%-", " "):gsub("^.", string.upper)); end });
hosts = {};
@@ -318,9 +319,10 @@ function commands.status(arg)
else
show_message("Prosody is not running");
if not switched_user and current_uid ~= 0 then
- print("\nNote: You will also see this if prosodyctl is not running under the same");
- print(" user account as Prosody. Try running as root (e.g. with 'sudo' in front) to");
- print(" gain access to Prosody's real status.");
+ print("\nNote:")
+ print(" You will also see this if prosodyctl is not running under");
+ print(" the same user account as Prosody. Try running as root (e.g. ");
+ print(" with 'sudo' in front) to gain access to Prosody's real status.");
end
return 2
end
diff --git a/util/prosodyctl.lua b/util/prosodyctl.lua
index 4c6b6ea4..3b523a78 100644
--- a/util/prosodyctl.lua
+++ b/util/prosodyctl.lua
@@ -19,7 +19,10 @@ function adduser(params)
return false, "invalid-hostname";
end
- usermanager.create_user(user, password, host);
+ local ok = usermanager.create_user(user, password, host);
+ if not ok then
+ return false, "unable-to-save-data";
+ end
return true;
end