diff options
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -665,6 +665,18 @@ do_exec(Session *s, const char *command) | |||
665 | debug("Forced command '%.900s'", command); | 665 | debug("Forced command '%.900s'", command); |
666 | } | 666 | } |
667 | 667 | ||
668 | #ifdef AUDIT_EVENTS | ||
669 | if (command != NULL) | ||
670 | PRIVSEP(audit_run_command(command)); | ||
671 | else if (s->ttyfd == -1) { | ||
672 | char *shell = s->pw->pw_shell; | ||
673 | |||
674 | if (shell[0] == '\0') /* empty shell means /bin/sh */ | ||
675 | shell =_PATH_BSHELL; | ||
676 | PRIVSEP(audit_run_command(shell)); | ||
677 | } | ||
678 | #endif | ||
679 | |||
668 | #ifdef GSSAPI | 680 | #ifdef GSSAPI |
669 | if (options.gss_authentication) { | 681 | if (options.gss_authentication) { |
670 | temporarily_use_uid(s->pw); | 682 | temporarily_use_uid(s->pw); |
@@ -2321,6 +2333,10 @@ do_cleanup(Authctxt *authctxt) | |||
2321 | } | 2333 | } |
2322 | #endif | 2334 | #endif |
2323 | 2335 | ||
2336 | #ifdef AUDIT_EVENTS | ||
2337 | PRIVSEP(audit_event(CONNECTION_CLOSE)); | ||
2338 | #endif | ||
2339 | |||
2324 | /* remove agent socket */ | 2340 | /* remove agent socket */ |
2325 | auth_sock_cleanup_proc(authctxt->pw); | 2341 | auth_sock_cleanup_proc(authctxt->pw); |
2326 | 2342 | ||