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
This commit is contained in:
Ruslan Ermilov 2002-11-14 12:40:14 +00:00
parent 222e92877c
commit bedff4e805

View File

@ -335,6 +335,7 @@ closelog()
{
(void)_close(LogFile);
LogFile = -1;
LogTag = NULL;
connected = 0;
}