Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: running cgi as user other than nobody

by archen (Pilgrim)
on Apr 02, 2002 at 00:10 UTC ( [id://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?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://155887]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2024-04-26 04:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found