diff options
author | Ken Raeburn <raeburn@mit.edu> | 2009-12-03 02:17:24 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@mit.edu> | 2009-12-03 02:17:24 +0000 |
commit | df1f581ffeff2abb67ee4e6b6d4da13189b0d271 (patch) | |
tree | b7713e25a993a889a30ad39e09801ee69936e23e /src/kadmin | |
parent | 78989785a51de5a0516f67600c41cc3b85a49799 (diff) | |
download | krb5-df1f581ffeff2abb67ee4e6b6d4da13189b0d271.zip krb5-df1f581ffeff2abb67ee4e6b6d4da13189b0d271.tar.gz krb5-df1f581ffeff2abb67ee4e6b6d4da13189b0d271.tar.bz2 |
allow testing even if name->addr->name mapping doesn't work
Many of the tests are set up to fail if the local hostname can't be
mapped to an address and back to a name again. If the name results in
an address, and we can get a fully-qualified name or something that
looks like it, though, we should be able to just go ahead and run some
tests.
This is also closer to the current behavior of sname_to_principal when
reverse DNS is enabled.
ticket: 6590
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23439 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/kadmin')
-rwxr-xr-x | src/kadmin/testing/scripts/make-host-keytab.plin | 4 | ||||
-rwxr-xr-x | src/kadmin/testing/scripts/qualname.plin | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/kadmin/testing/scripts/make-host-keytab.plin b/src/kadmin/testing/scripts/make-host-keytab.plin index cf62ae7..dfe0b3a 100755 --- a/src/kadmin/testing/scripts/make-host-keytab.plin +++ b/src/kadmin/testing/scripts/make-host-keytab.plin @@ -54,8 +54,8 @@ chop ($canonhost = `hostname`); ($canonhost,$aliases,$addrtype,$length,@addrs) = gethostbyname($canonhost); die "couldn't get canonical hostname\n" if !($canonhost && @addrs); -($canonhost) = gethostbyaddr($addrs[0],$addrtype); -die "couldn't get canonical hostname\n" if (!$canonhost); +($canonhost2) = gethostbyaddr($addrs[0],$addrtype); +if ($canonhost2) { $canonhost = $canonhost2; } for (@princs) { s/xCANONHOSTx/$canonhost/g; diff --git a/src/kadmin/testing/scripts/qualname.plin b/src/kadmin/testing/scripts/qualname.plin index 883b7df..b712d89 100755 --- a/src/kadmin/testing/scripts/qualname.plin +++ b/src/kadmin/testing/scripts/qualname.plin @@ -6,13 +6,12 @@ if ($#ARGV == -1) { $hostname = $ARGV[0]; } -if (! (($type,$addr) = (gethostbyname($hostname))[2,4])) { +if (! (($name,$type,$addr) = (gethostbyname($hostname))[0,2,4])) { print STDERR "No such host: $hostname\n"; exit(1); } if (! ($qualname = (gethostbyaddr($addr,$type))[0])) { - print STDERR "No address information for host $hostname\n"; - exit(1); + $qualname = $name; } $qualname =~ tr/A-Z/a-z/; # lowercase our name for keytab use. |