From df9aed63a9d30c4778414a28648d41c2eaca50f9 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 23 Jan 2015 10:58:02 +0100 Subject: Security: Telnet only accessible from localhost --- doc/example.mux | 2 +- src/RemoteControl.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/example.mux b/doc/example.mux index ec34238..09151e9 100644 --- a/doc/example.mux +++ b/doc/example.mux @@ -46,7 +46,7 @@ general { remotecontrol { ; enable the telnet remote control server on the given port ; This server allows you to read and define parameters that - ; some features export + ; some features export. It is only accessible from localhost. ; Set the port to 0 to disable the server telnetport 12721 diff --git a/src/RemoteControl.cpp b/src/RemoteControl.cpp index c8fb0e8..e46bc8d 100644 --- a/src/RemoteControl.cpp +++ b/src/RemoteControl.cpp @@ -67,7 +67,8 @@ void RemoteControllerTelnet::process(long) try { boost::asio::io_service io_service; - tcp::acceptor acceptor(io_service, tcp::endpoint(tcp::v4(), m_port)); + tcp::acceptor acceptor(io_service, tcp::endpoint( + boost::asio::ip::address::from_string("127.0.0.1"), m_port) ); while (m_running) { in_message = ""; @@ -225,8 +226,7 @@ void RemoteControllerTelnet::dispatch_command(tcp::socket& socket, string comman reply(socket, "Error: Invalid parameter value. "); } } - else - { + else { reply(socket, "Incorrect parameters for command 'set'"); } } -- cgit v1.2.3