[asterisk-bugs] [Asterisk 0015474]: Race condition in cdr_syslog.c (SVN Revision 205561)

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Jul 9 08:59:29 CDT 2009


The following issue has been ASSIGNED. 
====================================================================== 
https://issues.asterisk.org/view.php?id=15474 
====================================================================== 
Reported By:                praise
Assigned To:                seanbright
====================================================================== 
Project:                    Asterisk
Issue ID:                   15474
Category:                   CDR/NewFeature
Reproducibility:            sometimes
Severity:                   minor
Priority:                   normal
Status:                     assigned
Asterisk Version:           SVN 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 205561 
Request Review:              
====================================================================== 
Date Submitted:             2009-07-09 06:28 CDT
Last Modified:              2009-07-09 08:59 CDT
====================================================================== 
Summary:                    Race condition in cdr_syslog.c (SVN Revision 205561)
Description: 
There is a race condition in these lines of code:

openlog(sink->ident, LOG_CONS, sink->facility);
syslog(sink->priority, "%s", ast_str_buffer(str));
closelog();

openlog interferes with all syslog calls in the process. Since asterisk
is multithreaded, some other syslog message may be sent with syslog
ident/facility, or some other call to openlog might interfere with this
module's
syslog call.
This is not going to happen very often, but nevertheless it is an issue.

I have resolved here piping to a different process which routes all
messages
to syslog with correct values,but implementation of a global syslog
manager could be a more elegant solution.

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-07-09 08:59 russell        Status                   new => assigned     
2009-07-09 08:59 russell        Assigned To               => seanbright      
======================================================================




More information about the asterisk-bugs mailing list