You could have sudo not ever require a password for a certain command with an entry in /etc/sudoers:
Code:
mikuro ALL= NOPASSWD: /path/to/command
Or for the setuid route, it looks like in Leopard setting the setuid bit isn't enough any more -- the code also has to call setuid(), which is the way it should be, I believe. So for example:
Code:
#include <stdio.h>
int main(void)
{
if (setuid(0) < 0)
fprintf(stderr, "setuid() failed\n");
else
system("/usr/bin/whoami");
return(0);
} Try that with the setuid bit set and it should do what you want.
I'll spare you the usual security warnings and all that...
Bookmarks