From d2d24acfdf015d73c9eafbe8a5948dd78ea543e2 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Thu, 4 Oct 2018 15:54:38 -0400 Subject: [PATCH] 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 --- request.c | 7 ------- test/test_suite.sh | 6 +----- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/request.c b/request.c index 72bc04e5..b4657b55 100644 --- a/request.c +++ b/request.c @@ -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) { diff --git a/test/test_suite.sh b/test/test_suite.sh index 2ceb1ab9..45189986 100644 --- a/test/test_suite.sh +++ b/test/test_suite.sh @@ -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)' }