It won't work.  The filename of the real server is passed to tcpd
in argv[0] which is lost in "#!" execution.

PC486$ cat test.pl
#!/bin/perl
print "\$^X\t<$^X>\n";
print "\$0\t<$0>\n";
print "\$ARGV[0]\t<$ARGV[0]>\n";
print "\$ARGV[1]\t<$ARGV[1]>\n";
PC486$ (exec -a /some/server ./test.pl server-arg)
$^X     </bin/perl>
$0      </dev/fd/3>
$ARGV[0]        <server-arg>
$ARGV[1]        <>

Personally, I think tcpd abuses argv[0].  Can GNU fix it?

Reply via email to