From 7ee7df058b197d1b6e24fbed703f5af044f7ff0b Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Mon, 9 Dec 2019 13:42:05 +0100 Subject: [PATCH] syslogd: Only default to log rotation on actual files Signed-off-by: Joachim Nilsson --- src/syslogd.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/syslogd.c b/src/syslogd.c index 29f675f..46f34b4 100644 --- a/src/syslogd.c +++ b/src/syslogd.c @@ -2336,10 +2336,6 @@ static struct filed *cfline(char *line) return NULL; } - /* default rotate from command line */ - f->f_rotatecount = RotateCnt; - f->f_rotatesz = RotateSz; - /* scan through the list of selectors */ for (p = line; *p && *p != '\t' && *p != ' ';) { @@ -2544,6 +2540,14 @@ static struct filed *cfline(char *line) f->f_flags |= RFC3164; break; + case F_FILE: + /* default rotate from command line */ + if (f->f_rotatesz == 0) { + f->f_rotatecount = RotateCnt; + f->f_rotatesz = RotateSz; + } + /* fallthrough */ + default: /* All other targets default to RFC3164 */ if (f->f_flags & (RFC3164 | RFC5424))