- (dtucker) [Makefile.in auth.c auth.h auth1.c auth2.c loginrec.c monitor.c
monitor.h monitor_wrap.c monitor_wrap.h session.c sshd.c] Bug #125:
(first stage) Add audit instrumentation to sshd, currently disabled by
default. with suggestions from and djm@
diff --git a/loginrec.c b/loginrec.c
index e77318b..0fa9bde 100644
--- a/loginrec.c
+++ b/loginrec.c
@@ -154,6 +154,7 @@
#include "atomicio.h"
#include "packet.h"
#include "canohost.h"
+#include "auth.h"
#ifdef HAVE_UTIL_H
# include <util.h>
@@ -163,7 +164,7 @@
# include <libutil.h>
#endif
-RCSID("$Id: loginrec.c,v 1.63 2005/02/02 12:30:25 dtucker Exp $");
+RCSID("$Id: loginrec.c,v 1.64 2005/02/02 13:20:53 dtucker Exp $");
/**
** prototypes for helper functions in this file
@@ -443,6 +444,12 @@
!sys_auth_record_login(li->username,li->hostname,li->line))
logit("Writing login record failed for %s", li->username);
#endif
+#ifdef AUDIT_EVENTS
+ if (li->type == LTYPE_LOGIN)
+ audit_session_open(li->line);
+ else if (li->type == LTYPE_LOGOUT)
+ audit_session_close(li->line);
+#endif
return (0);
}