vishalmishra434 / rpms / openssh

Forked from rpms/openssh 3 months ago
Clone
Jan F f9ff10
diff -up openssh-5.8p1/audit-linux.c.audit1a openssh-5.8p1/audit-linux.c
Jan F f9ff10
--- openssh-5.8p1/audit-linux.c.audit1a	2011-02-24 13:16:51.000000000 +0100
Jan F f9ff10
+++ openssh-5.8p1/audit-linux.c	2011-02-24 13:17:17.000000000 +0100
Jan F f9ff10
@@ -143,7 +143,7 @@ audit_connection_from(const char *host, 
Jan F f9ff10
 void
Jan F f9ff10
 audit_run_command(const char *command)
Jan F f9ff10
 {
Jan F f9ff10
-	if (!user_login_count++) 
Jan F f9ff10
+	if (!user_login_count++ && !options.use_pam) 
Jan F f9ff10
 		linux_audit_user_logxxx(the_authctxt->pw->pw_uid, NULL, get_remote_name_or_ip(utmp_len, options.use_dns),
Jan F f9ff10
 		    NULL, "ssh", 1, AUDIT_USER_LOGIN);
Jan F f9ff10
 	linux_audit_user_logxxx(the_authctxt->pw->pw_uid, NULL, get_remote_name_or_ip(utmp_len, options.use_dns),
Jan F f9ff10
@@ -155,7 +155,7 @@ audit_end_command(const char *command)
Jan F f9ff10
 {
Jan F f9ff10
 	linux_audit_user_logxxx(the_authctxt->pw->pw_uid, NULL, get_remote_name_or_ip(utmp_len, options.use_dns),
Jan F f9ff10
 	    NULL, "ssh", 1, AUDIT_USER_END);
Jan F f9ff10
-	if (!--user_login_count) 
Jan F f9ff10
+	if (!--user_login_count && !options.use_pam) 
Jan F f9ff10
 		linux_audit_user_logxxx(the_authctxt->pw->pw_uid, NULL, get_remote_name_or_ip(utmp_len, options.use_dns),
Jan F f9ff10
 		    NULL, "ssh", 1, AUDIT_USER_LOGOUT);
Jan F f9ff10
 }
Jan F f9ff10
@@ -163,7 +163,7 @@ audit_end_command(const char *command)
Jan F f9ff10
 void
Jan F f9ff10
 audit_session_open(struct logininfo *li)
Jan F f9ff10
 {
Jan F f9ff10
-	if (!user_login_count++) 
Jan F f9ff10
+	if (!user_login_count++ && !options.use_pam) 
Jan F f9ff10
 		linux_audit_user_logxxx(li->uid, NULL, li->hostname,
Jan F f9ff10
 		    NULL, li->line, 1, AUDIT_USER_LOGIN);
Jan F f9ff10
 	linux_audit_user_logxxx(li->uid, NULL, li->hostname,
Jan F f9ff10
@@ -175,7 +175,7 @@ audit_session_close(struct logininfo *li
Jan F f9ff10
 {
Jan F f9ff10
 	linux_audit_user_logxxx(li->uid, NULL, li->hostname,
Jan F f9ff10
 	    NULL, li->line, 1, AUDIT_USER_END);
Jan F f9ff10
-	if (!--user_login_count) 
Jan F f9ff10
+	if (!--user_login_count && !options.use_pam) 
Jan F f9ff10
 		linux_audit_user_logxxx(li->uid, NULL, li->hostname,
Jan F f9ff10
 		    NULL, li->line, 1, AUDIT_USER_LOGOUT);
Jan F f9ff10
 }