[Fedora-directory-devel] Please review: [Bug 304161] logrotation time of -1 causes hang

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Summary: logrotation time of -1 causes hang

https://bugzilla.redhat.com/show_bug.cgi?id=304161


Opened by Ulf Weltman (ulf@xxxxxxxxxx) on 2007-09-24 17:48 EST [reply]
Someone set nsslapd-auditlog-logrotationtime to -1, and when log rotation time
comes around we spin forever here in log.c:
           while (loginfo.log_audit_rotationsyncclock <= loginfo.log_au
dit_ctime) {
                  loginfo.log_audit_rotationsyncclock += loginfo.log_audit
_rotationtime_secs;
           }

(gdb) print loginfo.log_audit_rotationsyncclock
$7 = -1
(gdb) print loginfo.log_audit_ctime
$8 = 1190782632
(gdb) print loginfo.log_audit_rotationtime_secs
$9 = -86400

-1 is obviously not a valid configuration but if someone is bored they could add
some boundary checking there.

------- Additional Comments From nhosoi@xxxxxxxxxx  2007-10-03 15:07 EST -------
Created an attachment (id=214931)
 --> (https://bugzilla.redhat.com/attachment.cgi?id=214931&action="">)
cvs diff ldapserver/ldap/servers/slapd/log.c

Thank you, Ulf, for finding out an interesting bug!

It's not good to wait forever in the while loops...

Change description:
1. slapd_log_audit_proc, slapd_log_error_proc_internal, and log_flush_buffer:
use absolute value of rotationtime_secs to calculate the rotationsyncclock.
2. when the result of "atoi" for nsslapd-XXX-logrotationtime is 0 due to the
invalid setting, logrotation time is reset to -1 (no rotation).
3. if nsslapd-XXX-logrotationtime and nsslapd-XXX-logexpirationtime is large
(near MAXINT) and calculated rotationtime_secs and/or exptime_secs is
overflown, set MAXINT to the sec value.

Thanks,
--noriko

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

--
Fedora-directory-devel mailing list
Fedora-directory-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-directory-devel

[Index of Archives]     [Fedora Directory Announce]     [Fedora Users]     [Older Fedora Users Mail]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Review]     [Fedora Art]     [Fedora Music]     [Fedora Packaging]     [CentOS]     [Fedora SELinux]     [Big List of Linux Books]     [KDE Users]     [Fedora Art]     [Fedora Docs]

  Powered by Linux