From: Paul Mackerras Date: Wed, 21 Aug 2024 08:26:49 +0000 (+1000) Subject: pppd: Log a message when the peer successfully authenticates itself to us X-Git-Tag: v2.5.1~18 X-Git-Url: https://git.ozlabs.org/?a=commitdiff_plain;h=b36a97864dd117cfa8e4e005945de37aa8334ea7;p=ppp.git pppd: Log a message when the peer successfully authenticates itself to us Signed-off-by: Paul Mackerras --- diff --git a/pppd/auth.c b/pppd/auth.c index bb692d7..fec815e 100644 --- a/pppd/auth.c +++ b/pppd/auth.c @@ -1031,10 +1031,12 @@ auth_peer_success(int unit, int protocol, int prot_flavor, char *name, int namelen) { int bit; + const char *prot; switch (protocol) { case PPP_CHAP: bit = CHAP_PEER; + prot = "CHAP"; switch (prot_flavor) { case CHAP_MD5: bit |= CHAP_MD5_PEER; @@ -1051,12 +1053,15 @@ auth_peer_success(int unit, int protocol, int prot_flavor, break; case PPP_PAP: bit = PAP_PEER; + prot = "PAP"; break; case PPP_EAP: bit = EAP_PEER; + prot = "EAP"; break; default: warn("auth_peer_success: unknown protocol %x", protocol); + prot = "unknown protocol"; return; } @@ -1068,6 +1073,7 @@ auth_peer_success(int unit, int protocol, int prot_flavor, BCOPY(name, peer_authname, namelen); peer_authname[namelen] = 0; ppp_script_setenv("PEERNAME", peer_authname, 0); + notice("Peer %q authenticated with %s", peer_authname, prot); /* Save the authentication method for later. */ auth_done[unit] |= bit;