summaryrefslogtreecommitdiffstats
path: root/src/kadmin/testing/scripts/make-host-keytab.pl.in
diff options
context:
space:
mode:
authorEzra Peisach <epeisach@mit.edu>1996-10-15 10:43:25 +0000
committerEzra Peisach <epeisach@mit.edu>1996-10-15 10:43:25 +0000
commit846dc8827cbcc6aa38ea5a06e3782b3e7a37b5bb (patch)
tree6c6961be8b482ddcdcdd69ee8150854db0e770b3 /src/kadmin/testing/scripts/make-host-keytab.pl.in
parentb619bebed5da0d7e8131c29b5c93110bb9dd88f8 (diff)
downloadkrb5-846dc8827cbcc6aa38ea5a06e3782b3e7a37b5bb.tar.gz
krb5-846dc8827cbcc6aa38ea5a06e3782b3e7a37b5bb.tar.xz
krb5-846dc8827cbcc6aa38ea5a06e3782b3e7a37b5bb.zip
* Makefile.in: Added standard rules for .plin -> .pl
* *.plin: Renamed from *.pl.in All files copied in source tree to preserve history - cvs update will create properly. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9170 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/kadmin/testing/scripts/make-host-keytab.pl.in')
-rw-r--r--src/kadmin/testing/scripts/make-host-keytab.pl.in144
1 files changed, 0 insertions, 144 deletions
diff --git a/src/kadmin/testing/scripts/make-host-keytab.pl.in b/src/kadmin/testing/scripts/make-host-keytab.pl.in
deleted file mode 100644
index ad509c35c..000000000
--- a/src/kadmin/testing/scripts/make-host-keytab.pl.in
+++ /dev/null
@@ -1,144 +0,0 @@
-#!/usr/local/bin/perl
-
-$server = undef;
-@princs = ();
-$top = undef;
-
-($whoami = $0) =~ s,.*/,,;
-$usage = "Usage: $whoami [ -server server ] [ -princ principal ]
- [ -top dirname ] [ -verbose ] filename
- Server defaults to the local host.
- Default principals are host/hostname\@SECURE-TEST.OV.COM and
- test/hostname\@SECURE-TEST.OV.COM.
- If any principals are specified, the default principals are
- not added to the srvtab.
- The string \"xCANONHOSTx\" in a principal specification will be
- replaced by the canonical host name of the local host.";
-
-@ORIG_ARGV = @ARGV;
-
-while (($_ = $ARGV[0]) && /^-/) {
- shift;
- if (/^-server$/) {
- ($server = shift) || die "Missing argument to $_ option.\n$usage\n";
- }
- elsif (/^-princ$/) {
- ($princ = shift) || die "Missing argument to $_ option.\n$usage\n";
- push(@princs, $princ);
- }
- elsif (/^-top$/) {
- ($top = shift) || die "Missing argument to $_ option.\n$usage\n";
- }
- elsif (/^-verbose$/) {
- $verbose++;
- }
- elsif (/^--$/) {
- last;
- }
- else {
- die "Unknown option $_.\n$usage\n";
- }
-}
-
-@princs = ("host/xCANONHOSTx\@SECURE-TEST.OV.COM",
- "test/xCANONHOSTx\@SECURE-TEST.OV.COM")
- if (! @princs);
-
-$ktfile = shift(@ARGV) || die "need a keytab file\n";
-
-$verbose++ if ($ENV{'VERBOSE_TEST'});
-
-print "In $0 @ORIG_ARGV...\n" if ($verbose);
-
-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);
-
-for (@princs) {
- s/xCANONHOSTx/$canonhost/g;
-}
-
-die "Neither \$TOP nor \$TESTDIR is set, and -top not specified.\n"
- if (! ($top || $ENV{'TOP'} || $ENV{'TESTDIR'}));
-
-$top = $ENV{'TOP'} if (! $top);
-$TESTDIR = ($ENV{'TESTDIR'} || "$top/testing");
-$MAKE_KEYTAB = ($ENV{'MAKE_KEYTAB'} || "$TESTDIR/scripts/$whoami");
-$SRVTCL = ($ENV{'SRVTCL'} || "$TESTDIR/util/ovsec_kadm_srv_tcl");
-$TCLUTIL = ($ENV{'TCLUTIL'} || "$TESTDIR/tcl/util.t");
-# This'll be wrong sometimes
-$RSH_CMD = ($ENV{'RSH_CMD'} || '/usr/ucb/rsh');
-$KADMIN = ($ENV{'KADMIN'} || "$top/cli/kadmin.local");
-
-if ($server) {
-# XXX Using /usr/ucb/rsh for now.
-
-# Strip command line options because we're adding our own.
-
- $MAKE_KEYTAB =~ s/ .*//;
-
- if ($ENV{'TOP'} && ($top ne $ENV{'TOP'})) {
-# Replace the old TOP with the new one where necessary
- for ('TESTDIR', 'SRVTCL', 'TCLUTIL', 'MAKE_KEYTAB') {
- eval "\$$_ =~ s/^\$ENV{'TOP'}/\$top/;";
- }
-
-# Make the paths as short as possible so our command line isn't too long.
-# for ('SRVTCL', 'TCLUTIL', 'MAKE_KEYTAB') {
-# eval "\$$_ =~ s/^\$TESTDIR/\\\\\\\$TESTDIR/;";
-# }
-# for ('TESTDIR', 'SRVTCL', 'TCLUTIL', 'MAKE_KEYTAB') {
-# eval "\$$_ =~ s/^\$top/\\\\\\\$TOP/;";
-# }
- }
-
- $cmd = "cd $top; \\`testing/scripts/find-make.sh\\` execute TOP=$top ";
- $cmd .= "VERBOSE_TEST=$verbose " if ($verbose);
- $cmd .= "TESTDIR=$TESTDIR ";
- $cmd .= "SRVTCL=$SRVTCL ";
- $cmd .= "TCLUTIL=$TCLUTIL ";
-
- $cmd .= "CMD='$MAKE_KEYTAB ";
- for (@princs) {
- $cmd .= "-princ $_ ";
- }
- $cmd .= " /tmp/make-keytab.$canonhost.$$'";#';
-
- $cmd = "$RSH_CMD $server -l root -n \"$cmd\"";
-
- $cmd2 = "$RSH_CMD $server -l root -n \"cat /tmp/make-keytab.$canonhost.$$\" > $ktfile";
-
- $cmd3 = "$RSH_CMD $server -l root -n \"rm /tmp/make-keytab.$canonhost.$$\"";
-
- for ($cmd, $cmd2, $cmd3) {
- print "$_\n" if ($verbose);
-
- system($_) && die "Couldn't run $_: $!.\n";
- }
-}
-else {
- $redirect = "> /dev/null" if (! $verbose);
-
- # We can ignore errors here, because the ktadd below will fail if
- # this fails for any reason other than "principal exists"
- for (@princs) {
- next if (/^kadmin/);
- $cmd = "$KADMIN -q 'ank -randkey $_' $redirect 2>&1";
- system($cmd);
- }
-
- $cmd = "$KADMIN -q 'ktadd -k $ktfile ";
- $cmd .= " -q " if (! $verbose);
- $cmd .= "@princs' $redirect";
- if (system "$cmd") {
- sleep(1);
- die "Error in system($cmd)\n";
- }
-}
-
-if (! -f $ktfile) {
- die "$ktfile not created.\n";
-}