mirror of
https://github.com/pi-hole/FTL.git
synced 2024-10-26 16:52:18 +02:00
Kill the >kill command
FTL now hosts the DNS server for the network, so allowing anyone to kill it is a security issue. Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
This commit is contained in:
@@ -138,13 +138,6 @@ void process_request(char *client_message, int *sock)
|
||||
close(*sock);
|
||||
*sock = 0;
|
||||
}
|
||||
else if(command(client_message, ">kill"))
|
||||
{
|
||||
processed = true;
|
||||
ssend(*sock, "killed\n");
|
||||
logg("FTL killed by client ID: %i",*sock);
|
||||
killed = 1;
|
||||
}
|
||||
|
||||
if(!processed)
|
||||
{
|
||||
|
||||
+1
-5
@@ -249,9 +249,5 @@ load 'libs/bats-support/load'
|
||||
}
|
||||
|
||||
@test "Final part of the tests: Killing pihole-FTL process" {
|
||||
run bash -c 'echo ">kill" | nc -v 127.0.0.1 4711'
|
||||
echo "output: ${lines[@]}"
|
||||
[[ ${lines[0]} == "Connection to 127.0.0.1 4711 port [tcp/*] succeeded!" ]]
|
||||
[[ ${lines[1]} == "killed" ]]
|
||||
[[ ${lines[2]} == "---EOM---" ]]
|
||||
run bash -c 'kill $(pidof pihole-FTL)'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user