Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: running cgi as user other than nobody

by archen (Pilgrim)
on Apr 02, 2002 at 00:10 UTC ( #155887=note: print w/replies, xml ) Need Help??

in reply to running cgi as user other than nobody

Out of curiosity, what OS is this running on? As a sort of blind stab in the dark, I'd say having permissions at 0666 should be good enough, but I've run into similar problems with permissions myself. If the script is called by Apache, it's probably run as nobody - which will first require that nobody can write to the target directory. You might also consider explicitly chmod'ing the files to 0766 after you've written them - although this shouldn't be neccesary since generally who/whatever creates a file should own it.
  • Comment on Re: running cgi as user other than nobody

Replies are listed 'Best First'.
Re: Re: running cgi as user other than nobody
by emilford (Friar) on Apr 02, 2002 at 00:25 UTC
    I believe the script is being called by Apache, but then again, I'm not 100% sure. I have the directory set (for testing only) to 777 and the file I'm trying to modify is set to 666. I'm still not able to make any changes...always get a Permission Denied. I also get a Permission Denied error when trying to chmod the file from within the script. Could I be doing this wrong?
      well if you can't chmod the file within the same script then I'd say you're overlooking something (hard to say without looking at the code). I've never actually seen an instance where something like this doesn't work:
      ... open(FILE, ">$file") || die $!; ... [stuff] close(FILE); chmod 0666 $file;
      Opening the file later might still be another issue...

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://155887]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2018-03-18 10:56 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (230 votes). Check out past polls.