From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter =?utf-8?q?M=C3=BCller?= To: development@lists.ipfire.org Subject: [PATCH 3/3] change AllowAgentForwarding in SSHD configuration if, necessary Date: Mon, 08 Apr 2019 16:35:00 +0000 Message-ID: <3222f6d5-4cb7-1914-609e-9856fb5ff73d@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1784642179839161740==" List-Id: --===============1784642179839161740== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Fixes #11931 Signed-off-by: Peter M=C3=BCller Cc: Michael Tremer --- src/misc-progs/sshctrl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/misc-progs/sshctrl.c b/src/misc-progs/sshctrl.c index 30074973d..476dbc9d5 100644 --- a/src/misc-progs/sshctrl.c +++ b/src/misc-progs/sshctrl.c @@ -76,6 +76,11 @@ int main(int argc, char *argv[]) else strlcat(command, "s/^Port .*$/Port 222/", STRING_SIZE - 1 ); =20 + if(findkey(kv, "SSH_AGENT_FORWARDING", buffer) && !strcmp(buffer,"on")) + strlcat(command, "s/^AllowAgentForwarding .*$/AllowAgentForwarding yes= /;", STRING_SIZE - 1 ); + else + strlcat(command, "s/^AllowAgentForwarding .*$/AllowAgentForwarding no/= ;", STRING_SIZE - 1 ); + freekeyvalues(kv); =20 snprintf(buffer, STRING_SIZE - 1, "' /etc/ssh/sshd_config >&%d", config_= fd ); --=20 2.16.4 --===============1784642179839161740==--