Established method to enable suid scripts?

Randal L. Schwartz merlyn at stonehenge.com
Sat May 14 19:25:01 UTC 2011


>>>>> "Pan" == Pan Tsu <inyaoo at gmail.com> writes:

Pan> ...a shebang can be written with sudo in mind, e.g.

Pan>   #! /usr/bin/env -S sudo sh
Pan>   id

(Untested) why not just "#!/usr/local/bin/sudo" ?  It'll be given the
filename as an argument.

Aside: In general, almost every use of "#!/usr/bin/env XXX" as a
solution is wrong.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.posterous.com/ for Smalltalk discussion


More information about the freebsd-questions mailing list