From aff0ed820736610ce24be24ce246aeeb90ff5cd1 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Thu, 23 Dec 1999 01:25:13 +0000 Subject: [PATCH] add pap_logout_hook --- pppd/auth.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pppd/auth.c b/pppd/auth.c index 189e74d..83b0e06 100644 --- a/pppd/auth.c +++ b/pppd/auth.c @@ -32,7 +32,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id: auth.c,v 1.59 1999/11/20 05:11:01 paulus Exp $" +#define RCSID "$Id: auth.c,v 1.60 1999/12/23 01:25:13 paulus Exp $" #include #include @@ -126,6 +126,9 @@ int (*pap_auth_hook) __P((char *user, char *passwd, char **msgp, struct wordlist **paddrs, struct wordlist **popts)) = NULL; +/* Hook for a plugin to know about the PAP user logout */ +void (*pap_logout_hook) __P((void)) = NULL; + /* Hook for a plugin to get the PAP password for authenticating us */ int (*pap_passwd_hook) __P((char *user, char *passwd)) = NULL; @@ -349,8 +352,12 @@ link_terminated(unit) { if (phase == PHASE_DEAD) return; - if (logged_in) - plogout(); + if (pap_logout_hook) { + pap_logout_hook(); + } else { + if (logged_in) + plogout(); + } new_phase(PHASE_DEAD); notice("Connection terminated."); } -- 2.39.2