From bedff4e8054cd50b86cbefde159d79138aaef3dd Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Thu, 14 Nov 2002 12:40:14 +0000 Subject: [PATCH] Reset LogTag to NULL in closelog(3). This fixes mysterious crashes caused by dynamic PAM modules that call openlog(3) and closelog(3), e.g. ports/security/pam_pwdfile. What happened here is that the module first registered its "ident" with openlog(3), then PAM library unloaded module with dlclose(3), and the next call to syslog(3) resulted in SIGSEGV. MFC after: 3 days --- lib/libc/gen/syslog.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libc/gen/syslog.c b/lib/libc/gen/syslog.c index fa19907ca2c..261dd106314 100644 --- a/lib/libc/gen/syslog.c +++ b/lib/libc/gen/syslog.c @@ -335,6 +335,7 @@ closelog() { (void)_close(LogFile); LogFile = -1; + LogTag = NULL; connected = 0; }