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

dwmw2 reviewboard at asterisk.org
Fri Aug 26 17:49:51 CDT 2011


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

Review request for Asterisk Developers and Kevin Fleming.


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
-----

  /trunk/pbx/pbx_spool.c 333475 

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/20110826/62f5fdd8/attachment.htm>


More information about the asterisk-dev mailing list