"pasear" <wc******@csie.nctu.edu.tw> wrote in message
news:bl**********@netnews2.csie.nctu.edu.tw...
I find I can't run setuid perl script
when I do this on a Unix-like platform:
1.Create a file "setuid.pl":
#!/usr/bin/perl -T
2.chmod a+x setuid.pl
3.chmod u+s setuid.pl
then i try
shell> ./setuid.pl
Permission denied.
hmm...it always come out with this,
and it's not because i don't have execute permission.
The message was sent by perl,
can anyone tell me how should I write a setuid program in perl?
Without a external wrap on it.
Thank you very much.
Setuid scripts are very dangerous. I didn't think the operating system even
honored the setuid bit for scripts. Am I mistaken ? Perl gave me loads of
headaches even when I tried to convert the perl script to a binary file
using perl2exe. Even after 'untainting' all of the variables, there were
still many problems. I ended up having to re-write the program in C, which
also happens to be the safest way to run a program as setuid.