Author: soliton
Date: Tue Sep 2 12:00:11 2008
New Revision: 29187
URL: http://svn.gna.org/viewcvs/wesnoth?rev=29187&view=rev
Log:
* restrict shut_down and restart commands to use via the socket only
Modified:
branches/1.4/src/server/server.cpp
Modified: branches/1.4/src/server/server.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/1.4/src/server/server.cpp?rev=29187&r1=29186&r2=29187&view=diff
==============================================================================
--- branches/1.4/src/server/server.cpp (original)
+++ branches/1.4/src/server/server.cpp Tue Sep 2 12:00:11 2008
@@ -899,8 +899,9 @@
const std::string& help_msg = "Available commands are: ban(s) [<mask>]
[<time>] <reason>,"
"kick <mask>, k(ick)ban [<mask>] [<time>] <reason>,
help, metrics, netstats,"
" (lobby)msg <message>, motd [<message>], status
[<mask>],"
- " unban <ipmask>, shut_down [now], restart";
- if (command == "shut_down") {
+ " unban <ipmask>";
+ // Shutdown and restart commands can only be issued via the socket.
+ if (command == "shut_down" && issuer_name == "*socket*") {
if (parameters == "now") {
throw network::error("shut down");
} else {
@@ -914,7 +915,7 @@
#ifndef _WIN32 // Not sure if this works on windows
// TODO: check if this works in windows.
- } else if (command == "restart") {
+ } else if (command == "restart" && issuer_name == "*socket*") {
if (restart_command.empty()) {
out << "No restart_command configured! Not restarting.";
} else {
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits