From e0cd5c2660107e8498861716a25209795250df43 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Tue, 28 Apr 2015 16:06:47 +0200 Subject: [PATCH] on explicit user termination notify radious as soon --- src/sec-mod-auth.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/sec-mod-auth.c b/src/sec-mod-auth.c index c667b4fe..8de53841 100644 --- a/src/sec-mod-auth.c +++ b/src/sec-mod-auth.c @@ -507,7 +507,6 @@ int handle_sec_auth_session_close(int cfd, sec_mod_st *sec, const SecAuthSession (pack_func) cli_stats_msg__pack); } - seclog(sec, LOG_INFO, "temporarily closing session for %s "SESSION_STR, e->auth_info.username, e->auth_info.psid); if (req->has_uptime && req->uptime > e->stats.uptime) { e->stats.uptime = req->uptime; @@ -538,6 +537,13 @@ int handle_sec_auth_session_close(int cfd, sec_mod_st *sec, const SecAuthSession memset(&e->stats, 0, sizeof(e->stats)); expire_client_entry(sec, e); + if (e->status == PS_AUTH_USER_TERM) { + /* immediately disconnect the user */ + del_client_entry(sec, e); + } else { + seclog(sec, LOG_INFO, "temporarily closing session for %s "SESSION_STR, e->auth_info.username, e->auth_info.psid); + } + return 0; } @@ -799,8 +805,8 @@ void sec_auth_user_deinit(sec_mod_st *sec, client_entry_st *e) if (e->module == NULL) return; - seclog(sec, LOG_DEBUG, "permamently closing session of user '%s' "SESSION_STR, e->auth_info.username, e->auth_info.psid); if (e->auth_ctx != NULL) { + seclog(sec, LOG_DEBUG, "permamently closing session of user '%s' "SESSION_STR, e->auth_info.username, e->auth_info.psid); if (sec->perm_config->acct.amod != NULL && sec->perm_config->acct.amod->close_session != NULL && e->session_is_open != 0) { sec->perm_config->acct.amod->close_session(e->module->type, e->auth_ctx, &e->auth_info, &e->saved_stats, e->status); }