Summary:ASTERISK-17231: [patch] unopenable spool files not deleted
Reporter:David Chappell (chappell)Labels:
Date Opened:2011-01-12 09:48:12.000-0600Date Closed:2012-10-08 15:46:27
Versions:Frequency of
Environment:Attachments:( 0) spool_open_failure.diff
Description:If scan_service() cannot open the spool file, it logs a message saying that it will delete the file and calls remove_from_queue() to do it. However, remove_from_queue() fails to delete the spool file because struct outgoing has not yet been fully initialized.

I have attached a patch which fixes this by calling unlink() instead of remove_from_queue().

(The patch makes two other minor changes: 1) fixes a garbled comment and 2) moves a log messages so that it actually comes before the operation which it says is about to be performed.)

I am not sure that my patch represents the best way to fix this. For example, it might be better to fill in o->fn earlier so that an attempt can be mode to move the unopenable spool file into the archive directory.

****** STEPS TO REPRODUCE ******

Create a spool file with permissions which do not permit the user under which the Asterisk daemon is running to open it for reading.