diff --git a/src/guacd/proc.c b/src/guacd/proc.c index 9641ac05a..0d9c0c175 100644 --- a/src/guacd/proc.c +++ b/src/guacd/proc.c @@ -42,6 +42,7 @@ #include #include #include +#include /** * Parameters for the user thread. @@ -353,6 +354,12 @@ static void guacd_exec_proc(guacd_proc* proc, const char* protocol) { guacd_log(GUAC_LOG_DEBUG, "Requesting termination of client..."); result = guacd_timed_client_free(client, GUACD_CLIENT_FREE_TIMEOUT); + /* Reopen syslog now that client plugins have been unloaded. This fixes + guacd_log() segfaults in cases where the client plugins have called + openlog() causing syslog ident string to point to the plugin's + memory region. */ + openlog(GUACD_LOG_NAME, LOG_PID, LOG_DAEMON); + /* If client was unable to be freed, warn and forcibly kill */ if (result) { guacd_log(GUAC_LOG_WARNING, "Client did not terminate in a timely "