Fix audit_end_command to restore ControlPersist function (#1203900)

This commit is contained in:
Jakub Jelen 2015-04-02 17:24:56 +02:00
parent c028ac51a4
commit f78ec07f4b

View File

@ -1942,7 +1942,7 @@ diff -up openssh-6.8p1/session.c.audit openssh-6.8p1/session.c
session_by_tty(char *tty)
{
int i;
@@ -2532,6 +2561,31 @@ session_exit_message(Session *s, int sta
@@ -2532,6 +2561,32 @@ session_exit_message(Session *s, int sta
chan_write_failed(c);
}
@ -1951,7 +1951,7 @@ diff -up openssh-6.8p1/session.c.audit openssh-6.8p1/session.c
+session_end_command2(Session *s)
+{
+ if (s->command != NULL) {
+ if (s->ptyfd == -1)
+ if (s->command_handle != -1)
+ audit_end_command(s->command_handle, s->command);
+ free(s->command);
+ s->command = NULL;
@ -1963,7 +1963,8 @@ diff -up openssh-6.8p1/session.c.audit openssh-6.8p1/session.c
+session_end_command(Session *s)
+{
+ if (s->command != NULL) {
+ PRIVSEP(audit_end_command(s->command_handle, s->command));
+ if (s->command_handle != -1)
+ PRIVSEP(audit_end_command(s->command_handle, s->command));
+ free(s->command);
+ s->command = NULL;
+ s->command_handle = -1;