php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26075 File upload leak, cleanup not being performed
Submitted: 2003-11-01 23:03 UTC Modified: 2003-11-02 15:57 UTC
From: php at lektec dot com dot au Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.3.3 OS: FreeBSD 4.7
Private report: No CVE-ID: None
 [2003-11-01 23:03 UTC] php at lektec dot com dot au
Description:
------------
When uploading files via a form.  If the user cancels the upload via the stop button in the browser, the php script does not clean up the file reminants.  If upload is completed the temporary file /var/tmp/php[A-Za-Z0-9]6 is removed.  However in the case when the upload is aborted it is left behind.

I have never noticed this before so I assume its new.  Currently running a cron job to remove file reminants however this has a nasty sting if it goes unchecked on a server with many file uploads.

Note that I am also running php accelerator.

'./configure' '--enable-versioning' '--enable-memory-limit' '--with-layout=GNU' '--with-zlib-dir=/usr' '--disable-all' '--with-regex=php' '--disable-cli' '--with-apxs=/usr/local/sbin/apxs' '--with-bz2=/usr' '--enable-ctype' '--enable-ftp' '--with-gd' '--enable-gd-native-ttf' '--enable-gd-jis-conv' '--with-freetype-dir=/usr/local' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local' '--with-xpm-dir=/usr/local' '--with-imap=/usr/local' '--with-mysql=/usr/local' '--enable-overload' '--with-pcre-regex=yes' '--enable-posix' '--enable-session' '--with-sybase-ct=/usr/local' '--enable-tokenizer' '--enable-xml' '--with-expat-dir=/usr/local' '--with-zlib=yes' '--prefix=/usr/local' 'i386-portbld-freebsd4.7' 



Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-02 15:57 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

The solution to this problem is to set ignore_user_abort(true) on the forms that deal with file attachments. That way PHP will be able to remove the unused file uploads.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Aug 17 10:01:28 2024 UTC