in reply to Re^3: $0 in suid enabled script (not SUID)
in thread Insecure dependency in system under -T, with list form invocation

Fedora? Solaris.

Exactly as predicted, your script works as intended as I run it myself, but shows the same problem as the one I complained about, once I suid it, and run it as an other user:

$ id uid=54482(emagiro) gid=17465(ath) $ /tmp/showfile $0 /tmp/showfile filename /tmp/showfile __FILE__ /tmp/showfile $ chmod u+s /tmp/showfile $ ll /tmp/showfile -rwsr-xr-x 1 emagiro ath 208 Sep 15 16:37 /tmp/showfile ~> id uid=33629(eeivob05) gid=17465(ath) ~> /tmp/showfile $0 /dev/fd/4 filename /dev/fd/4 __FILE__ /dev/fd/4