"Todd C. Miller" <todd.mil...@courtesan.com> writes: > 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.
Nah, let's forget about this idea, for the sake of simplicity. >> > 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. The idea was to remain strict by default, but stay useful in case of missing user/group, as happened to Harald Dunkel (see misc@). The diff to implement this is rather small. But I would also be ok with newsyslog(8) making its best efforts. Your call. :) -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE