diff --git a/src/sec-mod-auth.c b/src/sec-mod-auth.c index c64ab8f4..0930dca1 100644 --- a/src/sec-mod-auth.c +++ b/src/sec-mod-auth.c @@ -597,7 +597,7 @@ void handle_sec_auth_ban_ip_reply(sec_mod_st *sec, const BanIpReplyMsg *msg) return; } -int handle_sec_auth_stats_cmd(sec_mod_st * sec, const CliStatsMsg * req) +int handle_sec_auth_stats_cmd(sec_mod_st * sec, const CliStatsMsg * req, pid_t pid) { client_entry_st *e; stats_st totals; @@ -633,6 +633,9 @@ int handle_sec_auth_stats_cmd(sec_mod_st * sec, const CliStatsMsg * req) e->discon_reason = req->discon_reason; } + /* update PID */ + e->acct_info.id = pid; + if (sec->perm_config->acct.amod == NULL || sec->perm_config->acct.amod->session_stats == NULL) return 0; diff --git a/src/sec-mod.c b/src/sec-mod.c index fd114abb..5b1c9bff 100644 --- a/src/sec-mod.c +++ b/src/sec-mod.c @@ -270,7 +270,7 @@ int process_worker_packet(void *pool, int cfd, pid_t pid, sec_mod_st * sec, cmd_ return -1; } - ret = handle_sec_auth_stats_cmd(sec, tmsg); + ret = handle_sec_auth_stats_cmd(sec, tmsg, pid); cli_stats_msg__free_unpacked(tmsg, &pa); return ret; } diff --git a/src/sec-mod.h b/src/sec-mod.h index 0686242c..8e2ea4af 100644 --- a/src/sec-mod.h +++ b/src/sec-mod.h @@ -146,7 +146,7 @@ int handle_sec_auth_init(int cfd, sec_mod_st *sec, const SecAuthInitMsg * req, p int handle_sec_auth_cont(int cfd, sec_mod_st *sec, const SecAuthContMsg * req); int handle_secm_session_open_cmd(sec_mod_st *sec, int fd, const SecmSessionOpenMsg *req); int handle_secm_session_close_cmd(sec_mod_st *sec, int fd, const SecmSessionCloseMsg *req); -int handle_sec_auth_stats_cmd(sec_mod_st * sec, const CliStatsMsg * req); +int handle_sec_auth_stats_cmd(sec_mod_st * sec, const CliStatsMsg * req, pid_t pid); void sec_auth_user_deinit(sec_mod_st * sec, client_entry_st * e); void sec_mod_server(void *main_pool, struct perm_cfg_st *config, const char *socket_file,