sshctrl: when enable or disable AllowTcpForwarding, change PermitOpen accordingly

Message ID 193f6bcf-8ca5-7b34-e70e-0ebab2872ae9@ipfire.org
State Accepted
Commit fe0984e07bb48922acae5a4993503455df9dec0d
Headers
Series sshctrl: when enable or disable AllowTcpForwarding, change PermitOpen accordingly |

Commit Message

Peter Müller Dec. 21, 2020, 8:55 p.m. UTC
  Fixes: #12546

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
---
 src/misc-progs/sshctrl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Patch

diff --git a/src/misc-progs/sshctrl.c b/src/misc-progs/sshctrl.c
index f855c5a4a..6e8652c84 100644
--- a/src/misc-progs/sshctrl.c
+++ b/src/misc-progs/sshctrl.c
@@ -67,10 +67,10 @@  int main(int argc, char *argv[])
 						strlcat(command, "s/^PasswordAuthentication .*$/PasswordAuthentication yes/;", STRING_SIZE - 1 );
 
 				if(findkey(kv, "ENABLE_SSH_PORTFW", buffer) && !strcmp(buffer,"on"))
-						strlcat(command, "s/^AllowTcpForwarding .*$/AllowTcpForwarding yes/;", STRING_SIZE - 1 );
+						strlcat(command, "s/^AllowTcpForwarding .*$/AllowTcpForwarding yes/;"	"s/^PermitOpen .*$/PermitOpen any/;", STRING_SIZE - 1 );
 				else
-						strlcat(command, "s/^AllowTcpForwarding .*$/AllowTcpForwarding no/;", STRING_SIZE - 1 );
-						
+						strlcat(command, "s/^AllowTcpForwarding .*$/AllowTcpForwarding no/;"	"s/^PermitOpen .*$/PermitOpen none/;", STRING_SIZE - 1 );
+
 				if(findkey(kv, "SSH_PORT", buffer) && !strcmp(buffer,"on"))
 						strlcat(command, "s/^Port .*$/Port 22/;", STRING_SIZE - 1 );
 				else