Solved

Change permission of http uploaded file FROM www using PHP chmod function on FreeBSD

Posted on 2008-10-22
4
401 Views
Last Modified: 2013-12-06
Files uploaded via http and moved via a PHP script are currently given the owner www:www.

I need these files to belong to a different user so they count towards their file quota and not toward www's.

I intend to use PHP's chmod function to change the owner but I appreciate that without some changing of privileges on the server this will not be possible.

The server is running FreeBSD. I have root access. What permissions do I need to add/change on the server to allow PHP, running as www, to change the owner of files belonging to www:www?
0
Comment
Question by:mikely
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 6

Expert Comment

by:Twisteddk
ID: 22784769
Offhand, the user/program executing the change need to be a part of the group www and the file must have +w permissions set for the group, then it should work.
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 125 total points
ID: 22785004
> I need these files to belong to a different user ..
only root can do a chown (except the OS is configured highly insecure)
0
 
LVL 62

Expert Comment

by:gheist
ID: 22785775
You can make shid directory and use umask 0007 inside php, so you have special group where to add users to write web files.
0
 

Author Closing Comment

by:mikely
ID: 31508997
It wasn't so much a solution as telling me what I was trying wouldn't work but offering no suggestion of how I might otherwise achieve the same affect.
0

Featured Post

Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question