You are here: File upload, suid directory and temporary dir « PHP « IT news, forums, messages
File upload, suid directory and temporary dir

Posted by ADNET Ghislain on 02/09/05 19:55

Hi,

I am trying to make upload files to belong to the ftp user of the
website and not the apache user.

As i run in module i tried to do this:

1/ create a temp dir on the website outside the documentroot, chown the
temp dir to my ftp user and allow the group to write,, put the same
group as the webserver on the tmp dir too.

2/ then chmod u+s it (so with suid on the directory) and at the end
i put my upload_tmp_dir setting to this directory.

I was quite sure it would solve the issue BUT ... (there is allway a
BUT... ;)

when i run the simple script at php.net it gives me this output :

--------------------------------------------------------------------------

File is valid, and was successfully uploaded.
Here is some more debugging info:Array
(
[userfile] => Array
(
[name] => afnic-adherent-200x80.gif
[type] => image/gif
[tmp_name] => /var/tmp/php2L6xR7
[error] => 0
[size] => 17710
)

)

------------------------------------------------------------------------

You see :

[tmp_name] => /var/tmp/php2L6xR7

and the file belong to the apache user... not the ftp one :(

So really i wonder if anyone found a solution to this problem, or can explain me why this setup fails ?

Best regards,
Ghislain.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация