cronie bug in centos 6

Recently tried to redirect all output from crontabs to syslog, instead of mail with ‘-s’ param on CentOS 6.3, but was observing some trash in syslog. Looked into cronie code and found stupid bug, that was there for several years:

while (EOF != (ch = getc(in))) {
bytes++;
if (mail)
putc(ch, mail);
}
#if defined(SYSLOG)
# WE ARE NOT IN WHILE LOOP HERE!
if (SyslogOutput) {
logbuf[bufidx++] = ch;
if ((ch == '\n') || (bufidx == sizeof(logbuf)-1)) {
if (ch == '\n')
logbuf[bufidx-1] = '';
else
logbuf[bufidx] = '';
syslog(LOG_INFO, "%s", logbuf);
bufidx = 0;
}
}
#endif


Centos, (or even Redhat, I suppose the code in RHEL is the same) do you have some basic tests? Argh… This was fixed in cronie-1.4.8 more than a year ago, but still not in RHEL.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s