skazat has asked for the wisdom of the Perl Monks concerning the following question:
Fellow monks,
A somewhat foolish problem I've gotten myself into.
I have a complex CGI script that likes to create DB_Files with it needs to save information, say, if a new user comes along and we need to log him. Actually, for the sake of clarity, this is a light-weight mailing list manager that I work on and people really love. For each list it managers, it creates (among other things) a DB_File that holds preferences and a text file that holds all the subscribers.
These files are created by the cgi script, usually in a directory that is chmod'd to 777.
This is all well and good and works sparkling, until I try to interact and use these files when running another script interactivly, or when the script is owned by me, and not nobody as the files are, since they're created by the cgi script.
For example, You can create a mailing list via the web browser, the mailing list files will be created, with the owner of 'nobody'. Now, if I have an aliased email address that pipes to a script that wants to open up the subscriber list to send out to everyone, it won't work, since this script is owned by me.
Is there a way that I can do this? Here's me scenario, I won't be given root access, so I can't chown() anything. I guess I could have the mailing list files chmoded to 777 on creation, but that seems a bit bad (security wise), but how much worse is that then having the directory at 777 as well?
I didn't run into this problem while developing, since my host runs SuEXEC, so my scripts are run by me, all the time. Is there a way to run SuEXEC on a per account basis that the owner of this account can change (something in a .htaccess file, perhaps)? Is there a way, say in procmail, to tell procmail to pipe to a script and then run the script from another user (nobody)
These are some things I'm thinking of, but haven't made a solid conclusion on how to fix this little problem.
any wisdom and help would be much appreciated.
-justin simoni
!skazat!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI Script Created Files Playing Nicely
by suaveant (Parson) on Apr 26, 2001 at 23:32 UTC | |
by feloniousMonk (Pilgrim) on Apr 27, 2001 at 00:03 UTC | |
by skazat (Chaplain) on Apr 27, 2001 at 00:46 UTC | |
by feloniousMonk (Pilgrim) on Apr 27, 2001 at 17:12 UTC | |
by skazat (Chaplain) on Apr 27, 2001 at 00:49 UTC | |
|
Re: CGI Script Created Files Playing Nicely
by gildir (Pilgrim) on Apr 27, 2001 at 13:23 UTC |