mirror of
https://github.com/pissnet/pissircd.git
synced 2025-07-29 22:42:24 +01:00
Fix crash with log destination 'syslog'.
This commit is contained in:
parent
acbedd5938
commit
c315751c2e
1 changed files with 17 additions and 13 deletions
30
src/log.c
30
src/log.c
|
@ -460,21 +460,25 @@ int config_run_log(ConfigFile *conf, ConfigEntry *block)
|
|||
if (!strcmp(cep->name, "file") || !strcmp(cep->name, "syslog"))
|
||||
{
|
||||
Log *log;
|
||||
/* First check if already exists... yeah this is a bit late
|
||||
* and ideally would have been done in config_test but...
|
||||
* that would have been lots of work for a (hopefully) rare case.
|
||||
*/
|
||||
for (log = temp_logs[LOG_DEST_DISK]; log; log = log->next)
|
||||
|
||||
if (!strcmp(cep->name, "file"))
|
||||
{
|
||||
if ((log->file && !strcmp(log->file, cep->value)) ||
|
||||
(log->filefmt && !strcmp(log->filefmt, cep->value)))
|
||||
/* First check if already exists... yeah this is a bit late
|
||||
* and ideally would have been done in config_test but...
|
||||
* that would have been lots of work for a (hopefully) rare case.
|
||||
*/
|
||||
for (log = temp_logs[LOG_DEST_DISK]; log; log = log->next)
|
||||
{
|
||||
config_warn("%s:%d: Ignoring duplicate log block for file '%s'. "
|
||||
"You cannot have multiple log blocks logging to the same file.",
|
||||
cep->file->filename, cep->line_number,
|
||||
cep->value);
|
||||
free_log_sources(sources);
|
||||
return 0;
|
||||
if ((log->file && !strcmp(log->file, cep->value)) ||
|
||||
(log->filefmt && !strcmp(log->filefmt, cep->value)))
|
||||
{
|
||||
config_warn("%s:%d: Ignoring duplicate log block for file '%s'. "
|
||||
"You cannot have multiple log blocks logging to the same file.",
|
||||
cep->file->filename, cep->line_number,
|
||||
cep->value);
|
||||
free_log_sources(sources);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
log = safe_alloc(sizeof(Log));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue