Skip to content

Commit

Permalink
pppd: Log a message when the peer successfully authenticates itself t…
Browse files Browse the repository at this point in the history
…o us

Signed-off-by: Paul Mackerras <[email protected]>
  • Loading branch information
paulusmack committed Aug 21, 2024
1 parent 0a35b8f commit b36a978
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pppd/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand All @@ -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;
Expand Down

0 comments on commit b36a978

Please sign in to comment.