Now having said that, some shells do have options that allow the observance of the setuid bit. Most shells do not have that option.
But if you absolutely must run something setuid root, I would much rather you wrap the commands of your shell in a small C program, using the system() call for instance, compile it, and then setuid on that compiled binary.
#include<stdio.h>
main(int h)
{
return (system("/run/whatever/here"));
}
Save this file with a .c extension, then compile this with gcc:
gcc myprog.cmv a.out mynewexe...then setuid on the compiled executable,
mynewexe. If you must. Be careful. By the way, you ever heard of sudo?

0 comments:
Post a Comment