2 # proftpd trips over dead memory after SIGHUP
4 # dead memory is left behind tls_module. As soon as SIGHUP
5 # is received tls_moudle gets re-initialized. If I understand
6 # code right we do unload/load. The unload operation removes
7 # all timers installed by module:
9 # 14388 #if defined(PR_SHARED_MODULE)
10 # 14389 static void tls_mod_unload_ev(const void *event_data, void *user_data) {
11 # 14390 if (strcmp("mod_tls.c", (const char *) event_data) == 0) {
12 # 14391 /* Unregister ourselves from all events. */
13 # 14392 pr_event_unregister(&tls_module, NULL, NULL);
15 # 14394 pr_timer_remove(-1, &tls_module);
16 # 14395 # if defined(TLS_USE_SESSION_TICKETS)
17 # 14396 scrub_ticket_keys();
18 # 14397 # endif /* TLS_USE_SESSION_TICKETS */
20 # line 14394 removes all timers installed by tls_module except this
22 # 6248 pr_log_debug(DEBUG9, MOD_TLS_VERSION
23 # 6249 ": scheduling new TLS session ticket key every %d %s",
24 # 6250 new_ticket_key_intvl, new_ticket_key_intvl != 1 ? "secs" : "sec");
26 # 6252 pr_timer_add(new_ticket_key_intvl, -1, NULL, new_ticket_key_timer_cb,
27 # 6253 "New TLS Session Ticket Key");
29 # the Session Ticket Key timer is not removed, because it is not
30 # bound to tls_module.
32 # I did same patch to upstream in pull request bellow:
33 # https://github.com/proftpd/proftpd/pull/770
36 --- a/contrib/mod_tls.c
37 +++ b/contrib/mod_tls.c
38 @@ -5563,7 +5563,7 @@ static int tls_init_ctx(void) {
39 ": scheduling new TLS session ticket key every %d %s",
40 new_ticket_key_intvl, new_ticket_key_intvl != 1 ? "secs" : "sec");
42 - pr_timer_add(new_ticket_key_intvl, -1, NULL, new_ticket_key_timer_cb,
43 + pr_timer_add(new_ticket_key_intvl, -1, &tls_module, new_ticket_key_timer_cb,
44 "New TLS Session Ticket Key");