Ticket #3451 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

WMS layer removes temp file before it has been fclosed

Reported by: pramsey Owned by: sdlime
Priority: normal Milestone: 5.6.2 release
Component: MapServer C Library Version: 5.6
Severity: normal Keywords:
Cc: warmerdam

Description

The mapwmslayer.c create a temporary image file, and then builds a temporary layerObj on top of it which is then passed to mapraster.c for rendering. When GDAL renders the file it fopens bit, but does not fclose it right away if CLOSE_CONNECTION=DEFER is set, which it is by default as of Mapserver 5.6. This can result in the mapwmslayer.c code running unlink() on the temporary file before fclose() has been run on it.

The attached patch tries to dodge the problem by setting the CLOSE_CONNECTION behavior to NORMAL for the temporary layerObj used to render the image file.

Attachments

close_connection.patch Download (0.5 KB) - added by pramsey 3 years ago.
Untested patch

Change History

Changed 3 years ago by pramsey

Untested patch

Changed 3 years ago by pramsey

Tested the patch and confirmed it fixes the problem observed. It does!

Changed 3 years ago by pramsey

  • status changed from new to closed
  • resolution set to fixed

Committed to 5.6 branch at r10138.

Committed to trunk at r10139.

Note: See TracTickets for help on using tickets.