You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Fester Zigterman Rustenburg <fe...@maximedia.nl> on 2013/12/11 12:10:15 UTC

[users@httpd] Apache fcgid suexec not deleting POSTed /tmp files

Hi,

Recently my /tmp dir has been filled with tmp uploaded files which are 
never cleaned up.
I am using debian 6, apache2-2.2.16 with mod_fcgid and php5, using 
Virtualmin.

A file is received with HTTP POST and stored in /tmp/fcgid.tmp.*, with 
perm 0600, owner www-data . This means that apache (running under user 
www-data) is receiving the file, after which the file is moved to 
~[site-user]/tmp, and processed further with suexec/fcgid/php5 (under 
user [site-user]).

I suspect that the /tmp file the process fcgid process running under 
[site-user] tries to delete the upload, but fails because /tmp has a 
sticky bit and may not delete it. Maybe the action fails because /tmp 
and ~[site-user]/tmp are on different partitions so it needs to 
copy/delete instead of renaming?

My question: Which process (httpd/fcgid/suexec/php5) is responsible for 
deleting the tmp file, and how might I fix this problem?

-- 

Kind regards,

*Fester Zigterman Rustenburg*
Software developer, Info-kanaal


	*Maximedia BV* | Lintelerweg 40, 7556 PD | Postbus 182, 7550 AD | 
Hengelo (Ov)
www.maximedia.nl <http://www.maximedia.nl> | f.zigterman@maximedia.nl 
<ma...@maximedia.nl> | +31 (0)74 851 3800



Re: [users@httpd] Re: Apache fcgid suexec not deleting POSTed /tmp files

Posted by Eric Covener <co...@gmail.com>.
On Mon, Dec 16, 2013 at 6:14 AM, Fester Zigterman Rustenburg
<fe...@maximedia.nl> wrote:
> Thanks for your mail.
>
> You say php handles the file uploads. That may be true, however, I do have a
> temp file named  /tmp/fcgid.tmp.* which are owned by the *Apache* user
> www-data, not the php [site-user].
>
> Mod_fcgid is creating temp files according to:
> http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html#fcgidmaxrequestinmem
>
> Unfortunately I still haven't discovered why they are not cleaned up after
> use.
>

It's supposed to be removed at the end of the frontend connection
associated with the request that created it.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Apache fcgid suexec not deleting POSTed /tmp files

Posted by Fester Zigterman Rustenburg <fe...@maximedia.nl>.
Thanks for your mail.

You say php handles the file uploads. That may be true, however, I do 
have a temp file named  /tmp/fcgid.tmp.* which are owned by the *Apache* 
user www-data, not the php [site-user].

Mod_fcgid is creating temp files according to: 
http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html#fcgidmaxrequestinmem

Unfortunately I still haven't discovered why they are not cleaned up 
after use.

Fester

On 12/12/2013 01:08 PM, Tom Evans wrote:
 > I'm fairly certain that mod_fcgid does not do a single thing with file
 > uploads - a file upload is usually simply an HTTP POST with a lot of
 > multipart POST data. PHP handles the file uploads itself by reading
 > this POST body, [...]


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Apache fcgid suexec not deleting POSTed /tmp files

Posted by Tom Evans <te...@googlemail.com>.
On Thu, Dec 12, 2013 at 10:31 AM, Fester Zigterman Rustenburg
<fe...@maximedia.nl> wrote:
> Hi,
>
> Sorry for posting HTML before.
> Is any one here using mod_fcgid, who has any idea how POST files are handled
> ?
>
> It seems that Ubuntu 12.04 (based on debian 6) does not have my problem
> using Apache 2.2.22, and I ruled out the different partition situation, so
> it must be something else.
>
> I would really appreciate any help, because i am stuck.
>
> Kind Regards,
>
> Fester Zigterman Rustenburg
> Maximedia

I'm fairly certain that mod_fcgid does not do a single thing with file
uploads - a file upload is usually simply an HTTP POST with a lot of
multipart POST data. PHP handles the file uploads itself by reading
this POST body, I thought:

http://www.php.net/manual/en/ini.core.php#ini.sect.file-uploads

Cheers

Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Re: Apache fcgid suexec not deleting POSTed /tmp files

Posted by Fester Zigterman Rustenburg <fe...@maximedia.nl>.
Hi,

Sorry for posting HTML before.
Is any one here using mod_fcgid, who has any idea how POST files are 
handled ?

It seems that Ubuntu 12.04 (based on debian 6) does not have my problem 
using Apache 2.2.22, and I ruled out the different partition situation, 
so it must be something else.

I would really appreciate any help, because i am stuck.

Kind Regards,

Fester Zigterman Rustenburg
Maximedia


On 12/11/2013 12:10 PM, I wrote:
> Hi,
>
> Recently my /tmp dir has been filled with tmp uploaded files which are 
> never cleaned up.
> I am using debian 6, apache2-2.2.16 with mod_fcgid and php5, using 
> Virtualmin.
>
> A file is received with HTTP POST and stored in /tmp/fcgid.tmp.*, with 
> perm 0600, owner www-data . This means that apache (running under user 
> www-data) is receiving the file, after which the file is moved to 
> ~[site-user]/tmp, and processed further with suexec/fcgid/php5 (under 
> user [site-user]).
>
> I suspect that the /tmp file the process fcgid process running under 
> [site-user] tries to delete the upload, but fails because /tmp has a 
> sticky bit and may not delete it. Maybe the action fails because /tmp 
> and ~[site-user]/tmp are on different partitions so it needs to 
> copy/delete instead of renaming?
>
> My question: Which process (httpd/fcgid/suexec/php5) is responsible 
> for deleting the tmp file, and how might I fix this problem?
>




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org