Resolve segfault with auditing commands (#1203900)
This commit is contained in:
parent
114dfef6d3
commit
acf98854ca
@ -1895,7 +1895,7 @@ diff -up openssh-6.8p1/session.c.audit openssh-6.8p1/session.c
|
|||||||
- PRIVSEP(audit_run_command(shell));
|
- PRIVSEP(audit_run_command(shell));
|
||||||
+ s->command = xstrdup(shell);
|
+ s->command = xstrdup(shell);
|
||||||
}
|
}
|
||||||
+ if (s->command != NULL && s->ttyfd == -1)
|
+ if (s->command != NULL && s->ptyfd == -1)
|
||||||
+ s->command_handle = PRIVSEP(audit_run_command(s->command));
|
+ s->command_handle = PRIVSEP(audit_run_command(s->command));
|
||||||
#endif
|
#endif
|
||||||
if (s->ttyfd != -1)
|
if (s->ttyfd != -1)
|
||||||
@ -1940,7 +1940,7 @@ diff -up openssh-6.8p1/session.c.audit openssh-6.8p1/session.c
|
|||||||
session_by_tty(char *tty)
|
session_by_tty(char *tty)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@@ -2532,6 +2561,30 @@ session_exit_message(Session *s, int sta
|
@@ -2532,6 +2561,31 @@ session_exit_message(Session *s, int sta
|
||||||
chan_write_failed(c);
|
chan_write_failed(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1948,7 +1948,8 @@ diff -up openssh-6.8p1/session.c.audit openssh-6.8p1/session.c
|
|||||||
+void
|
+void
|
||||||
+session_end_command2(Session *s)
|
+session_end_command2(Session *s)
|
||||||
+{
|
+{
|
||||||
+ if (s->command != NULL && s->ttyfd == -1) {
|
+ if (s->command != NULL) {
|
||||||
|
+ if (s->ptyfd == -1)
|
||||||
+ audit_end_command(s->command_handle, s->command);
|
+ audit_end_command(s->command_handle, s->command);
|
||||||
+ free(s->command);
|
+ free(s->command);
|
||||||
+ s->command = NULL;
|
+ s->command = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user