[asterisk-dev] [Code Review] Fix spool handling to allow call files to be hardlinked into place

dwmw2 reviewboard at asterisk.org
Sat Aug 27 03:33:38 CDT 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1391/
-----------------------------------------------------------

(Updated Aug. 27, 2011, 3:33 a.m.)


Review request for Asterisk Developers and Kevin Fleming.


Changes
-------

Add braces to make single-line if() statements harder to read.


Summary
-------

This fixes the inotify code to handle call files being hardlinked into the spool directory.

The smsq utility does this, instead of rename(), to ensure that it cannot accidentally overwrite an existing spool file. A rename() might do that, but link() will definitely not.

The inotify code had broken this, because it would wait for an IN_CLOSE_WRITE event on the file... which was never forthcoming, since it was never opened. Now we look for IN_OPEN events following the IN_CREATE event, and only wait for an IN_CLOSE_WRITE if the file was actually opened.


This addresses bug ASTERISK-18331.
    https://issues.asterisk.org/jira/browse/ASTERISK-18331


Diffs (updated)
-----

  /trunk/pbx/pbx_spool.c 333428 

Diff: https://reviewboard.asterisk.org/r/1391/diff


Testing
-------

Creating call files with rename(), with link() and also with open(O_CREAT).


Thanks,

dwmw2

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20110827/7d456075/attachment.htm>


More information about the asterisk-dev mailing list