From 38062597f289bd47c3f1c8c30d90602286ad9dd8 Mon Sep 17 00:00:00 2001 From: Barry Jaspan Date: Wed, 11 Sep 1996 21:01:46 +0000 Subject: [PATCH] * make-host-keytab.pl.in: use kadmin instead of kadm5_keytab git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9081 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kadmin/testing/scripts/ChangeLog | 4 ++++ .../testing/scripts/make-host-keytab.pl.in | 22 ++++++++++++------- .../testing/scripts/make-host-keytab.plin | 22 ++++++++++++------- 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/src/kadmin/testing/scripts/ChangeLog b/src/kadmin/testing/scripts/ChangeLog index 0a3dd5512..6ccb212a7 100644 --- a/src/kadmin/testing/scripts/ChangeLog +++ b/src/kadmin/testing/scripts/ChangeLog @@ -1,3 +1,7 @@ +Wed Sep 11 17:01:06 1996 Barry Jaspan + + * make-host-keytab.pl.in: use kadmin instead of kadm5_keytab + Mon Aug 12 11:36:57 1996 Barry Jaspan * init_db: use kdb5_util instead of kdb5_create diff --git a/src/kadmin/testing/scripts/make-host-keytab.pl.in b/src/kadmin/testing/scripts/make-host-keytab.pl.in index 14d7b10b5..ad509c35c 100644 --- a/src/kadmin/testing/scripts/make-host-keytab.pl.in +++ b/src/kadmin/testing/scripts/make-host-keytab.pl.in @@ -71,7 +71,7 @@ $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'); -$EDIT_KEYTAB = ($ENV{'EDIT_KEYTAB'} || "$top/keytab/kadm5_keytab.local"); +$KADMIN = ($ENV{'KADMIN'} || "$top/cli/kadmin.local"); if ($server) { # XXX Using /usr/ucb/rsh for now. @@ -122,14 +122,20 @@ if ($server) { else { $redirect = "> /dev/null" if (! $verbose); - $cmd = "$EDIT_KEYTAB -k $ktfile"; - $cmd .= " -q" if (! $verbose); - $cmd .= " -a -c"; + # We can ignore errors here, because the ktadd below will fail if + # this fails for any reason other than "principal exists" for (@princs) { - if (system "$cmd $_") { - sleep(1); - die "Error in system($cmd $_)\n"; - } + 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"; } } diff --git a/src/kadmin/testing/scripts/make-host-keytab.plin b/src/kadmin/testing/scripts/make-host-keytab.plin index 14d7b10b5..ad509c35c 100644 --- a/src/kadmin/testing/scripts/make-host-keytab.plin +++ b/src/kadmin/testing/scripts/make-host-keytab.plin @@ -71,7 +71,7 @@ $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'); -$EDIT_KEYTAB = ($ENV{'EDIT_KEYTAB'} || "$top/keytab/kadm5_keytab.local"); +$KADMIN = ($ENV{'KADMIN'} || "$top/cli/kadmin.local"); if ($server) { # XXX Using /usr/ucb/rsh for now. @@ -122,14 +122,20 @@ if ($server) { else { $redirect = "> /dev/null" if (! $verbose); - $cmd = "$EDIT_KEYTAB -k $ktfile"; - $cmd .= " -q" if (! $verbose); - $cmd .= " -a -c"; + # We can ignore errors here, because the ktadd below will fail if + # this fails for any reason other than "principal exists" for (@princs) { - if (system "$cmd $_") { - sleep(1); - die "Error in system($cmd $_)\n"; - } + 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"; } } -- 2.26.2