hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : Uploaded files with PHP get user:group apache
Reply

Hosting Security and Technology Configuring and optimizing web hosting servers and operating systems, developing administration scripts, building servers, protecting against hackers, and general security (SSL certificates, etc.)
Forum Jump

Uploaded files with PHP get user:group apache

Reply Post New Thread In Hosting Security and Technology Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 09-07-2005, 02:26 PM
GoranTornqvist GoranTornqvist is offline
Junior Guru Wannabe
 
Join Date: Apr 2005
Posts: 47

Uploaded files with PHP get user:group apache


Hello,
I have this problem.
A customer is using Mambo and is uploading new components thru the admin interface (PHP). The problem is that the files that is uploaded has owner and group apache after the upload so they cannot change/remove the file thru ftp.
Whats the correct way to solve this problem? change the umask?
chown only works as root so that's out of the question...

Thanks

Reply With Quote


Sponsored Links
  #2  
Old 09-07-2005, 04:50 PM
shockuk shockuk is offline
Developers Developers...
 
Join Date: Nov 2004
Location: England, UK, EU
Posts: 774
Basically, when uploading files through PHP, the owner of the file is whatever Apache is running as. AFAIK, if for example you run Apache as "dudesaccount" and then upload a file, the file will have the owner "dudesaccount". I don't think there is anyway to change this unfortunately (unless phpsuexec can? dunno, never looked into it...).

However, there are ways around this, but you'll have to change the PHP code (and if you don't know PHP, it will probably be a daunting task, you might want to hire someone).

1) During the upload process, you should be able to CHMOD the file as world-readable and world-writable. Do this by using the "chmod" command in PHP, as your script has permission to access the file, then it can change the permissions for other users accessing the file. Obviously not really suitable in a shared-hosting environment...

2) ...or, during the upload process, after the script has copied the file to where it wants it, you can then open it, then open an FTP connection with the user/pass of the website owner, and then use "ftp_fput" to *upload* the file from your script to the server.

Lot's of messing about I know, but that's all I can think of atm...

Reply With Quote
  #3  
Old 09-08-2005, 02:54 AM
GoranTornqvist GoranTornqvist is offline
Junior Guru Wannabe
 
Join Date: Apr 2005
Posts: 47
Thanks for you help...I had the feeling that there was a workaround using chmod.

Reply With Quote
Sponsored Links
Reply

Related posts from TheWhir.com
Title Type Date Posted
Researchers Urge System Admins to Check for New Apache Web Server Backdoor Malware Web Hosting News 2013-05-01 11:35:53
The Apache Software Foundation Launches Hadoop v1.0 Web Hosting News 2012-01-05 18:29:16
Oracle is the Latest Vendor to Apply Patch for Apache Killer Flaw Web Hosting News 2011-09-19 14:43:58
Hacker Group Lulzsec Disbands After 50 Days, Posts One Final Data Dump Web Hosting News 2011-06-27 14:59:08
Web Host Future Hosting Adds New Features to CDN Web Hosting News 2011-06-16 17:30:23


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?