From c8062c4be37ff5adc1b781fb12156f15f808f429 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Mar 11 2015 17:08:59 +0000 Subject: Fix auditing when using combination of ForceCommand and PTY --- diff --git a/openssh-6.7p1-audit.patch b/openssh-6.7p1-audit.patch index 41401e7..2c1e80d 100644 --- a/openssh-6.7p1-audit.patch +++ b/openssh-6.7p1-audit.patch @@ -1947,7 +1947,7 @@ index 40a681e..acd87d5 100644 - PRIVSEP(audit_run_command(shell)); + s->command = xstrdup(shell); } -+ if (s->command != NULL) ++ if (s->command != NULL && s->ttyfd == -1) + s->command_handle = PRIVSEP(audit_run_command(s->command)); #endif if (s->ttyfd != -1) @@ -2000,7 +2000,7 @@ index 40a681e..acd87d5 100644 +void +session_end_command2(Session *s) +{ -+ if (s->command != NULL) { ++ if (s->command != NULL && s->ttyfd == -1) { + audit_end_command(s->command_handle, s->command); + free(s->command); + s->command = NULL;