Reset Ownership

AndyII

Verified User
Joined
Oct 3, 2006
Messages
566
little background, user has a script that when used changes the owner and permissions of a folder to Apache, after that if the user tries again it will show error because the folder is now owned by Apache.
In the DA control panel there is a quick way to reset ownership, is is possible to automate this process with a cron or a small php script at the user level?
 
You would have to run a chown with a script to give access back to the user. You should think about changing to suphp so scripts run as user instead of just webserver user.
 
thanks for the reply scsi,
yes I agree that would most definitely do the trick, I have read quite a bit on it, but so far is just one user and I am not sure enough in changing this server to use suphp, dont have the programmer that used to do these things as needed, so it it would have to be me and until I am more confident I wont dare try as of yet, perhaps it is more simple than I think, cant afford to break anything :(
 
Look at the script that is run it probably just needs a few changes so that it will chown the permissions back to the user after it is run.
 
yes, I think you are correct, its just the time needed to study the php code, you would think if script can change it one way, it could also change it back, I may write the author but not sure how far I will get and if they have the time as well.
 
A script running as apache will never be able to change file or diretory ownerships to the user. Before we switched to suPHP we wrote custom cronjobs, running as root (the only user that can by default do the ownership change) to do it every x minutes.

Jeff
 
thats what everyone is saying, and references online are the same as you say, but, the user created the folder at install (uploading files/folders), after the script runs, the owner of that folder is now Apache, how does that happen?
 
I don't know. I don't know if it's easy to figure it out. I just did some tests, and it appears impossible. I'd search all the apache logs for the user who ran the script, for anything to do with the specific files/folders.

Jeff
 
Back
Top