[tac_plus] [PATCH] log successful login attempts

Luca Boccassi lboccass at Brocade.com
Mon Dec 29 16:49:53 UTC 2014


Hi,

This small patch makes tac_plus log successful login attempts, which is
useful in our case for test automation purposes. Please let me know in
case the preferred format for patches is different.

Kind regards,
Luca Boccassi
Brocade Communications Systems


---
 default_fn.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

--- a/default_fn.c
+++ b/default_fn.c
@@ -206,7 +206,17 @@ default_fn(struct authen_data *data)
 	    report(LOG_NOTICE, "login failure: %s %s %s",
 		   name == NULL ? "unknown" : name,
 		   session.peerip, session.port);
+	return(0);
+
     case TAC_PLUS_AUTHEN_STATUS_PASS:
+	if (session.peer)
+	    report(LOG_NOTICE, "login success: %s %s (%s) %s",
+		   name == NULL ? "unknown" : name,
+		   session.peer, session.peerip, session.port);
+	else
+	    report(LOG_NOTICE, "login success: %s %s %s",
+		   name == NULL ? "unknown" : name,
+		   session.peerip, session.port);
 	return(0);
 
     default:



More information about the tac_plus mailing list