summaryrefslogtreecommitdiffstats
path: root/src/kadmin/testing/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/kadmin/testing/scripts')
-rwxr-xr-xsrc/kadmin/testing/scripts/make-host-keytab.plin4
-rwxr-xr-xsrc/kadmin/testing/scripts/qualname.plin5
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 cf62ae797..dfe0b3a01 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 883b7dfc8..b712d8973 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.