Jack,

"nobody" doesn't have permission to do this.  Even though the script
you're executing is owned by root, it's triggered by "nobody" so it's
running with nobody's permissions, not root's.

You'll have to run it with:

su root -c /home/bud/perms

I've never done this from a cgi script, so I don't know if it'll work (I
have my doubts).

Glen
[EMAIL PROTECTED]


 

On Tue, 1 Aug 2000,  Jack Barnett wrote:

>
>I sent this message once before, but my mail server was having problems and
>don't know if the message hit the list or not.  If this is a second or
>re-post my apolgises.
>
>
>
>On a cgi project I am working on, I need to run a shell script as root.  I
>know this is dangerous, but it has to been done.
>
>The c program looks like this:
>
>#include <unistd.h>
>
>void main()
> {
>   execl("/bin/sh","perm","/home/phone/perm",NULL);
> }
>
>with premissions:
>-rwsr-x---   1 root     nobody        11350 Jul 31 14:36 perms*
>
>and the shell script looks like this:
>
>#!/bin/sh
>
>chown -R user1 /home/bud/web/
>chgrp -R user1 /home/bud/web
>chmod 700 /home/bud/web
>
>with permissions:
>-r-x------   1 root     root         1659 Jul 31 14:29 perm*
>
>but everytime I execute it though a web browser or though the command:
>
>su nobody -c /home/bud/perms
>
>It says that nobody can't change owner and group on those files.
>
>
>Any ideas?  I am not a C programmer so you will have to be gentle with any
>examples.
>
>Thanks,
>Jack
>
>
>
>-
>To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
>the body of a message to [EMAIL PROTECTED]
>Please read the FAQ at http://www.linux-learn.org/faqs
>


-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.linux-learn.org/faqs

Reply via email to