non-GNU systems: serious bug in SA3 dependency
John Rudd
jrudd at UCSC.EDU
Sat Sep 4 23:39:11 IST 2004
<x-flowed>
On Sep 4, 2004, at 8:16 AM, Julian Field wrote:
> To find the fully-qualified hostname with the domain attached (ie the
> FQDN), it executes the command
> hostname --fqdn
>
> This will, on Solaris systems at least, set the hostname to the name
> "--fqdn" which probably isn't what your server is called. If you try
> this,
> change your hostname back *real* fast or all sorts of ugly shit will
> happen.
[snip]
> Thought you folks might appreciate the warning...
Oh, OUCH! Thank you for finding and reporting it. That's just
insidious. And it so violates the idea that Perl and its modules
should be portable.
(I mean, on my solaris systems, they can find my FQDN by just doing a
"hostname". My hostnames are all FQDN's because they need to be with
kerberos (inspite of the fact that Solaris has its own version of
kerberos in SEAM, solaris still insists upon only letting you use the
short host name, so you have to go fix the hostname before you try to
work with a real version of kerberos).)
It seems like a better code fix would be: grep for the domain entry in
resolv.conf, and check to see if the reported hostname ends with that
string, if it does, use that. If it doesn't, then check to see if the
reported hostname and the domain name exist in 1 line of the hosts
file. If it does, try to find an entry in that line that has both (in
case it's not just "shortname.domain", like
"shortname.subdomain.domain"). Otherwise, give shortname.domain.
Or, even, take the code in the GNU version of hostname, and convert
that to perl, and use that in the perl module.
I'm not suggesting YOU do that, I'm saying that's what the perl module
author should have done.
Speaking of which ... did you report this bug to that author? If you
didn't, and you don't have time to follow up with them and such, just
say so. I'll take this one on if you want to hand it off to someone.
John
------------------------ MailScanner list ------------------------
To unsubscribe, email jiscmail at jiscmail.ac.uk with the words:
'leave mailscanner' in the body of the email.
Before posting, read the MAQ (http://www.mailscanner.biz/maq/) and
the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).
</x-flowed>
More information about the MailScanner
mailing list