Implement session ID for TCP/UDP servers.
* imap4d/imap4d.c (set_strerr_flt,clr_strerr_flt): New functions. (imap4d_connection): Setup session prefix in strerr if mu_log_session_id is set. * imap4d/io.c (io_setio): Bugfix: unref debug stream. * pop3d/extra.c (pop3d_setio): Likewise. * pop3d/pop3d.c (set_strerr_flt,clr_strerr_flt): New functions. (pop3d_connection): Setup session prefix in strerr if mu_log_session_id is set. * include/mailutils/acl.h (mu_acl_setenv) (mu_acl_getenv,mu_acl_set_session_id): New functions. * include/mailutils/server.h (mu_session_id): New extern. (mu_m_server_configured_count): Fix signature. * include/mailutils/syslog.h (mu_log_session_id): New extern. * libmailutils/diag/syslog.c (mu_log_session_id): New global. * libmailutils/server/acl.c (_mu_acl) <envv,envc,envn>: New members. (run_closure) <env>: New member. (mu_acl_destroy): Free environment. (_acl_match): Handle "family" variable. (expand_arg): Propagate ACL environment to wordsplit. (mu_acl_check_sockaddr): Propagate ACL environment. (mu_acl_setenv) (mu_acl_getenv,mu_acl_set_session_id): New functions. * libmailutils/server/ipsrv.c (mu_ip_tcp_accept): Store session ID in the ACL. (mu_ip_udp_accept): Likewise. * libmailutils/server/msrv.c (mu_m_server_configured_count): Fix signature. (mu_m_server_check_acl): Store session ID in the ACL. * libmailutils/server/server.c (mu_session_id): New global variable. (connection_loop): Increment session ID (mu_acl_set_session_id): New function. * libmailutils/stream/fltstream.c (filter_ctl): Handle MU_IOCTL_SUBSTREAM. * libmailutils/stream/logstream.c (_log_ctl): Likewise. * libmu_cfg/common.c (mu_logging_param) <session-id>: New statement.
Showing
15 changed files
with
386 additions
and
42 deletions
-
Please register or sign in to post a comment