On Nov 30 Kirk Bailey wrote:

> This script is not perl, it is in python. So far the python community has
> failed in the search for clue, possibly this one can assist?
>

Python or not python is irrevelant here.
As last resort, if you don't want to use su, sudo or ksu, you can use
a setuid/setgid wrapper program to execute your script:

---- wrapper.c -----
#include <unistd.h>
#include <stdio.h>

int main(void)
{
        execlp("/full/path/to/script", "script", "arg1", "arg2", NULL);
        perror("script");
        return 1;
}
-------------------

arg1/arg2 is the first/second argument to the script, if any. ie:
"-c" "filename". If there is no args, then leave them out.

---- Makefile -----
PROG= wrapper
NOMAN= yep
.include <bsd.prog.mk>
-------------------

- put the wrapper.c and the Makefile in a dir, and issue the make command.
- change the owner (group), ie.: chown joeuser:joegroup wrapper
- turn the setuid bit on: chmod 04555 wrapper (not the script)

Hope this helps,

        -andrew



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message

Reply via email to