Tor: Disable SOCKS port if unused

Message ID 7ebcbd8d-254b-f71f-54d5-8b4b40f50f0d@ipfire.org
State Accepted
Commit 8a0be2033f8d932b1687df1b6515bfb72230acf2
Headers
Series Tor: Disable SOCKS port if unused |

Commit Message

Peter Müller Nov. 10, 2022, 7:31 p.m. UTC
  Fixes: #11780
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
---
 html/cgi-bin/tor.cgi | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
  

Patch

diff --git a/html/cgi-bin/tor.cgi b/html/cgi-bin/tor.cgi
index 539a74343..96be35102 100644
--- a/html/cgi-bin/tor.cgi
+++ b/html/cgi-bin/tor.cgi
@@ -2,7 +2,7 @@ 
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007-2021  IPFire Team  <info@ipfire.org>                     #
+# Copyright (C) 2007-2022  IPFire Team  <info@ipfire.org>                     #
 #                                                                             #
 # This program is free software: you can redistribute it and/or modify        #
 # it under the terms of the GNU General Public License as published by        #
@@ -796,7 +796,9 @@  sub BuildConfiguration() {
 		if ($strict_nodes > 0) {
 			print FILE "StrictNodes 1\n";
 		}
-	}
+	 } else {
+		print FILE "SocksPort 0\n";
+	 }
 
 	if ($settings{'TOR_RELAY_ENABLED'} eq 'on') {
 		# Reject access to private networks.