On Sat, 15 Jul 2017 00:24:05 +0200, Jeremie Courreges-Anglas wrote: > Wouldn't it be better if we at least tried to properly free what was > allocated in parse_file()?
I'm not sure it is worth it since newsyslog is a short-lived process. If you feel strongly about this I could take a look at doing that. > > One thing I wanted to > > do was to make parse_file() return an error value when there was a > > parse error so the exit code could be non-zero. > > That would be better, a valid use case is checking the exit status of > newsyslog -n to detect errors. That's what I was thinking as well. > Also, should we really ignore errors for everything, or only for > getpwnam/getgrnam(3) errors? The latter appears safer to me. Do you think a single bad line should prevent newsyslog from rotating any files? This could lead to /var/ filling up which seems more dangerous than just ignoring a bogus line. - todd