On Fri, 13 Oct 2000, Derek Martin <[EMAIL PROTECTED]> wrote:
> Today, Kevin D. Clark gleaned this insight:
>
>
> > > I hate being protected from myself!
> >
> > I find Perl's taint checks and other warning mechanisms to be much
> > more helpful than harmful.
>
> I would be inclined to agree if I knew how to use them to achieve my goal,
> but at the moment I don't, and as yet my goal has gone unrealized...
>
> > Do what you think is best.
>
> I just want it to WORK! :)
Ignoring any security concerns, this will work as a wrapper for just
about any program:
haystack[112] cat ~/suid_test.c
#include <unistd.h>
#define CMD "/root/test.sh"
main () {
printf("uid: %d\neuid: %d\n", getuid(), geteuid());
setuid(0);
printf("uid: %d\neuid: %d\n\n", getuid(), geteuid());
execl(CMD, CMD, NULL);
exit(1);
}
Set CMD to full path to script/program. printf's are just for debugging.
Depending on what you are doing you may not need the setuid(0) call.
Then do "chown root.root" and chmod u+s on the binary as root.
(or substitute whatever user you want)
Karl
**********************************************************
To unsubscribe from this list, send mail to
[EMAIL PROTECTED] with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe gnhlug
**********************************************************