Fix TLS streams
Avoid calling gnutls_global_init (via mu_tls_module_init) prior to forking. gnutls_global_init opens at least one file descriptor (/dev/urandom), and closing it will disrupt its operation. Current stable libgnutls (3.3.15) is able to cope with it, but there are plenty of systems running much older versions. * libmailutils/server/msrv.c (mu_m_server_begin): Reset onexit list after forking. * libmu_auth/tls.c (mu_tls_module_init): Don't call mu_init_tls_libs. (_tls_server_open, _tls_client_open): Check return value from mu_init_tls_libs. * imap4d/auth_gsasl.c (auth_gsasl): Use mu_onexit to register onexit functions. * imap4d/imap4d.h (util_atexit): Remove prototype. * imap4d/starttls.c (imap4d_starttls): Don't register mu_deinit_tls_libs: now done by tls library. (starttls_init): Don't call mu_init_tls_libs. * imap4d/util.c (util_atexit): Remove. (util_bye): Update accordingly. * pop3d/extra.c (pop3d_setio): Print informational message after establishing TLS. (pop3d_bye): Don't call mu_deinit_tls_libs: that's done by the library. * pop3d/pop3d.c (main): Don't call mu_init_tls_libs.
Showing
8 changed files
with
31 additions
and
52 deletions
-
Please register or sign in to post a comment