[Nagiosplug-devel] [Nagiosplug-checkins] nagiosplug/plugins-scripts/t utils.t, NONE, 1.1
Andreas Ericsson
ae at op5.se
Fri Oct 27 10:39:19 CEST 2006
Ton Voon wrote:
> Update of /cvsroot/nagiosplug/nagiosplug/plugins-scripts/t
> In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv7073/t
>
> Added Files:
> utils.t
> Log Message:
> Fixed regression where hostnames with hyphens were rejected (1581402 - Holger Weiss)
>
>
> --- NEW FILE: utils.t ---
> #!/usr/bin/perl -w -I ..
> #
> # utils.pm tests
> #
> # $Id: utils.t,v 1.1 2006/10/26 21:02:21 tonvoon Exp $
> #
>
> #use strict;
> use Test::More;
> use NPTest;
>
> use lib "..";
> use utils;
>
> my $hostname_checks = {
> "www.altinity.com" => 1,
> "www.888.com" => 1,
> "888.com" => 1,
> "host-hyphened.com" => 1,
> "rubbish" => 1,
> "-start.com" => 0,
> "endsindot." => 0,
This is a bit odd, really. There's nothing wrong with a hostname ending
in a dot. What *is* odd is a hostname ending in a dot that cannot be a
fully qualified domainname. "www.google.gom." is actually the *real*
address. "www.google.com" gets auto-translated to add the last dot if
there is none, whereas "www.google." is not a real address. This is not
because it ends with a dot, but because it's missing the top-domain and
the ending dot forbids library functions to amend anything to it.
I would suggest changing the test-hostname to "nonfqdn-but-ends-in-dot."
so as to not confuse future hackers.
--
Andreas Ericsson andreas.ericsson at op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
More information about the Devel
mailing list