DirkNiblick Posted May 17, 2006 Posted May 17, 2006 (edited) I would like to change my photo gallery to allow photo uploads from relatives, etc. The problem is that if someone uploads a photo, it's then owned by the nobody user. I've been told this is not a good thing plus I know it isn't because then I can't move or delete the files later as "spolemn". I'd like the PHP script to upload the photo, resize the photo into another directory, and then change the ownership to "spolemn". How can I accomplish the final part? Is there a script/command I can exec() to do this? Edited May 17, 2006 by DirkNiblick Quote
TweezerMan Posted May 17, 2006 Posted May 17, 2006 I'd like the PHP script to... change the ownership to "spolemn". How can I accomplish the final part? Is there a script/command I can exec() to do this? Unfortunately, there is no way for you to do this. Only the root user (i.e. the Help Desk) has the ability to change the owner of a file or directory. (This is a security restriction by the operating system.) You basically have two options here: 1) Ask the Help Desk to change the ownership of uploaded files from "nobody" to your user ID every time one or more files are uploaded. 2) Configure your script to run as CGI script. As a CGI script, your script would run under your user ID instead of "nobody", so any files uploaded and created by such a script would be automatically owned by you. You didn't say what script you were using for your photo gallery, so I don't know how feasible option #2 would be. Quote
TCH-Tim Posted May 17, 2006 Posted May 17, 2006 1) Ask the Help Desk to change the ownership of uploaded files from "nobody" to your user ID every time one or more files are uploaded. well, maybe not every time you upload a photo *TCH-Tim cringes at the thought of waking up to hundreds of tickets to change file ownership on pictures Quote
DirkNiblick Posted May 17, 2006 Author Posted May 17, 2006 Well, I guess I'll just have to leave them as owned by nobody. Thanks anyway. Quote
TCH-Tim Posted May 17, 2006 Posted May 17, 2006 Well, I guess I'll just have to leave them as owned by nobody. Thanks anyway. I didn't say we wouldn't change ownership for you, I'm just asking that you batch your requests rather than open twenty tickets every day. I'm sure you can see my concern. What script are you using? Maybe we can help you come up with a different method. Quote
DirkNiblick Posted May 18, 2006 Author Posted May 18, 2006 It's a PHP photo gallery I've written. I want to allow my relatives to upload pictures into the directories. Like I said, there's nothing wrong with letting the nobody user do it until I want to move/delete files created that way. I suppose I could just send in a help desk ticket to chown the directory. Quote
flashram Posted May 18, 2006 Posted May 18, 2006 Why not use Coppermine as your gallery, then you shouldn't have any problems with ownership etc. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.