sesman: move auth_start_session, auth_stop_session, and auth_end to child process
@@ -457,7 +457,6 @@ session_start_fork(tbus data, tui8 type, struct SCP_CONNECTION *c,
return 0;
}
- auth_start_session(data, display);
pid = g_fork(); /* parent is fork from tcp accept,
child forks X and wm, then becomes scp */
@@ -466,6 +465,9 @@ session_start_fork(tbus data, tui8 type, struct SCP_CONNECTION *c,
}
else if (pid == 0)
{
+ log_message(LOG_LEVEL_INFO, "calling auth_start_session from pid %d",
+ g_getpid());
+ auth_start_session(data, display);
g_delete_wait_obj(g_term_event);
g_tcp_close(g_sck);
g_tcp_close(c->in_sck);
@@ -788,6 +790,10 @@ session_start_fork(tbus data, tui8 type, struct SCP_CONNECTION *c,
g_waitpid(window_manager_pid);
log_message(LOG_LEVEL_ALWAYS, "window manager (pid %d) did "
"exit, cleaning up session", window_manager_pid);
+ log_message(LOG_LEVEL_INFO, "calling auth_stop_session and "
+ "auth_end from pid %d", g_getpid());
+ auth_stop_session(data);
+ auth_end(data);
g_sigterm(display_pid);
g_sigterm(chansrv_pid);
g_deinit();
@@ -917,8 +923,6 @@ session_kill(int pid)
if (tmp->item->pid == pid)
{
- auth_stop_session(tmp->item->data);
- auth_end(tmp->item->data);
/* deleting the session */
log_message(LOG_LEVEL_INFO, "++ terminated session: username %s, display :%d.0, session_pid %d, ip %s", tmp->item->name, tmp->item->display, tmp->item->pid, tmp->item->client_ip);
g_free(tmp->item);
