Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Item12084: CGI.pm has a private class called CGITempFile which is use…
…d to hold a handle to a temporary file. The idea is that when the CGI object is reaped, the temporary files are automatically unlinked. However, when Sandbox::sysCommand is invoked - for example, by loading a topic before the uploads have been processed - a subprocess is created that gets a copy of the parent process, including these objects. When the subprocess terminates, the CGITempFiles are DESTROYed and the external files unlinked, leaving the parent process with pointers to non- existant temporary files. We solve this problem by patching the DESTROY method on CGITempFile so that the temporary files are only ever destroyed by the parent process, and never by the child. We do this by comparing the PID with a PID recorded when the CGI object is constructed. git-svn-id: http://svn.foswiki.org/trunk@16968 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
- Loading branch information