Hi,

I had a similar problem the other day and got help from this list.

When you run your script through the browser, it is not executed by you 
(your username), but by the user of the webserver. Apache normally uses the 
username "nobody". You can check this by looking into httpd.conf. The 
reason for this is security. The user nobody normally has very restricted 
rights.

If you have problems with it you can change

- the user name Apache is using - but then you could have problems with 
security - of course you need the right to change httpd.conf
- rights, e.g. let the script chmod the output to 777 - but then you could 
have the same problems with security and it is not always possible without 
root rights
- owner - but then you have to have root rights

or write another cgi-script ... this is what I did in the end

My particular problem was that files were created and deleted by a 
cgi-script - in reality by nobody. Whenever the script had a problem, files 
were created but not deleted. I could not delete them with my user name as 
I was not the owner of the files. I have no root rights. So I wrote another 
cgi-script to get rid of the files.

I hope my answer helps you a little bit.

Anette

At 06:03 15.10.02, David Gerler wrote:
>How do I make a script run as a specific user.
>
>I am working on a script that uses a pipe to send information to a
>program that outputs to a file. It works on win2000. I have uploaded
>it and it runs and works correctly when run in the debugger from a
>shell with the command "perl -d". The only time it doesn't run is when
>it is called as an action from a form in a browser. The only
>difference that I can find is that when call from the browser it runs
>as "nobody". In the debugger it runs as the login user and works
>correctly.
>         When I say that it runs as nobody, I mean that the file output from
>the pipe is owned by "nobody".
>         Can anyone shed any light on this? How can I make the file run as my
>user? Alternately, how do I make it chown the file to me. This is on a
>virtual host server.
>
>David Gerler
>Gerler Enterprises
>PO Box 16357
>Chesapeake VA 23328
>(757) 410-0738
>http://www.GerlerEnterprises.com/
>
>Nationwide Dial-up from $12.45 /mo.
>http://www.EasySitesForLess.com/
>
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to