Deleted Added
full compact
audit.c (181110) audit.c (221420)
1/* $Id: audit.c,v 1.5 2006/09/01 05:38:36 djm Exp $ */
1/* $Id: audit.c,v 1.6 2011/01/17 10:15:30 dtucker Exp $ */
2
3/*
4 * Copyright (c) 2004, 2005 Darren Tucker. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright

--- 132 unchanged lines hidden (view full) ---

142/*
143 * Called when a user session is started. Argument is the tty allocated to
144 * the session, or NULL if no tty was allocated.
145 *
146 * Note that this may be called multiple times if multiple sessions are used
147 * within a single connection.
148 */
149void
2
3/*
4 * Copyright (c) 2004, 2005 Darren Tucker. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright

--- 132 unchanged lines hidden (view full) ---

142/*
143 * Called when a user session is started. Argument is the tty allocated to
144 * the session, or NULL if no tty was allocated.
145 *
146 * Note that this may be called multiple times if multiple sessions are used
147 * within a single connection.
148 */
149void
150audit_session_open(const char *ttyn)
150audit_session_open(struct logininfo *li)
151{
151{
152 const char *t = ttyn ? ttyn : "(no tty)";
152 const char *t = li->line ? li->line : "(no tty)";
153
154 debug("audit session open euid %d user %s tty name %s", geteuid(),
155 audit_username(), t);
156}
157
158/*
159 * Called when a user session is closed. Argument is the tty allocated to
160 * the session, or NULL if no tty was allocated.
161 *
162 * Note that this may be called multiple times if multiple sessions are used
163 * within a single connection.
164 */
165void
153
154 debug("audit session open euid %d user %s tty name %s", geteuid(),
155 audit_username(), t);
156}
157
158/*
159 * Called when a user session is closed. Argument is the tty allocated to
160 * the session, or NULL if no tty was allocated.
161 *
162 * Note that this may be called multiple times if multiple sessions are used
163 * within a single connection.
164 */
165void
166audit_session_close(const char *ttyn)
166audit_session_close(struct logininfo *li)
167{
167{
168 const char *t = ttyn ? ttyn : "(no tty)";
168 const char *t = li->line ? li->line : "(no tty)";
169
170 debug("audit session close euid %d user %s tty name %s", geteuid(),
171 audit_username(), t);
172}
173
174/*
175 * This will be called when a user runs a non-interactive command. Note that
176 * it may be called multiple times for a single connection since SSH2 allows
177 * multiple sessions within a single connection.
178 */
179void
180audit_run_command(const char *command)
181{
182 debug("audit run command euid %d user %s command '%.200s'", geteuid(),
183 audit_username(), command);
184}
185# endif /* !defined CUSTOM_SSH_AUDIT_EVENTS */
186#endif /* SSH_AUDIT_EVENTS */
169
170 debug("audit session close euid %d user %s tty name %s", geteuid(),
171 audit_username(), t);
172}
173
174/*
175 * This will be called when a user runs a non-interactive command. Note that
176 * it may be called multiple times for a single connection since SSH2 allows
177 * multiple sessions within a single connection.
178 */
179void
180audit_run_command(const char *command)
181{
182 debug("audit run command euid %d user %s command '%.200s'", geteuid(),
183 audit_username(), command);
184}
185# endif /* !defined CUSTOM_SSH_AUDIT_EVENTS */
186#endif /* SSH_AUDIT_EVENTS */