Subject: | Bogus argument for 'hostname' command |
This piece of code breaks noisily on MacOS X because '--fqdn' is not a valid option for the
'hostname' command.
./5.8.6/Sys/Hostname/Long.pm:71: 'exec_hostname_fqdn' => {
./5.8.6/Sys/Hostname/Long.pm:72: 'title' => 'Execute "hostname --fqdn"',
./5.8.6/Sys/Hostname/Long.pm-73- 'description' => '',
./5.8.6/Sys/Hostname/Long.pm-74- 'exec' => sub {
./5.8.6/Sys/Hostname/Long.pm-75- # Skip for Solaris, and only run as non-
root
./5.8.6/Sys/Hostname/Long.pm-76- my $tmp;
./5.8.6/Sys/Hostname/Long.pm-77- if ($< == 0) {
./5.8.6/Sys/Hostname/Long.pm:78: $tmp = `su nobody -c "hostname
--fqdn"`;
./5.8.6/Sys/Hostname/Long.pm-79- } else {
./5.8.6/Sys/Hostname/Long.pm:80: $tmp = `hostname --fqdn`;
./5.8.6/Sys/Hostname/Long.pm-81- }
./5.8.6/Sys/Hostname/Long.pm-82- $tmp =~ tr/\0\r\n//d;
./5.8.6/Sys/Hostname/Long.pm-83- return $tmp;
MacOS X should probably get treated like the BSD's, since 'hostname' without args returns
the FQDN if the host has one configured, as does uname -n.