Can't delete server created files.

Associate
Joined
18 Oct 2002
Posts
1,581
Location
Nottingham
A php script has created some folders and files and the owner is set to the server and now i can't delete them! anyway of doing this? or am i stuck?
 
You're stuck! Ask your host :)

Reason is because for various reasons/principles the webserver commonly runs under its own user, which isn't your username :)
 
have just noticed when i actually looked that, i used simplegal for a bit and that has created all the thumbnails and sized images as the server owner but i can delete them.... even tho the owner is '99' and im like '32556'.

Is it because the folder the thumbs are in, in this new gallery are set to 99 but the thumbs in simplegal gallery or in a folder i created and therefore the folder owner is me '32556'?
 
i have answered my own question, aslong as the files are in a folder that i have created then i can delete them, otherwise im stuck!

Means im gonna have to get my host to delete the entire gallery folder now there is 20 or so images in there that i cant delete! frustrating!! :mad:
 
The way around it is to suexec PHP so that it runs under your user, but that's less secure in that a rogue script could obliteratify your entire home directory....and goes against the principle of 'least privileges'...the webserver, and any service, should only have the minimum necessary access unless explicitly granted.

There's upsides and downsides to both ways :)

Luckily a chown/rm is something even a level 1 monkey could do in his sleep in half a second, so it's not so bad.
 
tried to edit the script so that any files or folders created by it made me the owner. However using chown() it had a little cry, i think it was to do with the fact the servers uid and mine were not in the same group? It was a safe_mode error.

Inquisitor said:
I had this before with SimpleGal, 'tis a pain in the arse :(

I wrote a little script that you select delete file or folder, then put in the filename (relative to the place this file is uploaded) hit submit and it deletes it (aslong as the rwx permissions are right on the file you are trying to delete. Should work on simplegal created files)
 
Last edited:
Back
Top Bottom