From: Ezra Peisach Date: Wed, 10 May 1995 20:55:57 +0000 (+0000) Subject: Added domain_realm stanza to krb5.conf. X-Git-Tag: krb5-1.0-beta6~2005 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=edd07f89f6ecf14c338dd4f953a016104beb5f09;p=krb5.git Added domain_realm stanza to krb5.conf. setup_srvtab: Takes optional service name to extract for keytab git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5792 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/tests/dejagnu/config/ChangeLog b/src/tests/dejagnu/config/ChangeLog index db7bf663a..01475fada 100644 --- a/src/tests/dejagnu/config/ChangeLog +++ b/src/tests/dejagnu/config/ChangeLog @@ -1,3 +1,10 @@ +Wed May 10 16:53:28 1995 Ezra Peisach + + * default.exp: Added domain_realm stanza to krb5.conf. + setup_srvtab: Takes optional service name to + extract. + + Fri May 05 09:21:21 1995 Chris Provenzano (proven@mit.edu) * default.exp : Removed FILE: part of env(KRB5CCNAME). diff --git a/src/tests/dejagnu/config/default.exp b/src/tests/dejagnu/config/default.exp index e162ef36b..aa308fc26 100644 --- a/src/tests/dejagnu/config/default.exp +++ b/src/tests/dejagnu/config/default.exp @@ -39,7 +39,8 @@ if ![info exists KEY] { # Clear away any files left over from a previous run. # We can't use them now because we don't know the right KEY. -catch "exec rm -f tmpdir/db.ok tmpdir/srvtab" +# krb5.conf might change if running tests on another host +catch "exec rm -f tmpdir/db.ok tmpdir/srvtab tmpdir/krb5.conf" # Put the installed kerberos directories on PATH. # This needs to be fixed for V5. @@ -164,6 +165,7 @@ proc get_hostname { } { global RESOLVE global hostname global localhostname + global domain if {[info exists hostname] && [info exists localhostname]} { return 1 @@ -183,11 +185,12 @@ proc get_hostname { } { } close $file catch "exec rm -f tmpdir/hostname" exec_output - regexp "^\[^.\]*" $hostname localhostname + regexp "^(\[^.\]*)\.(.*)$" $hostname foo localhostname domain set hostname [string tolower $hostname] set localhostname [string tolower $localhostname] - verbose "hostname: $hostname; localhostname: $localhostname" + set domain [string tolower $domain] + verbose "hostname: $hostname; localhostname: $localhostname; domain $domain" return 1 } @@ -199,6 +202,7 @@ proc get_hostname { } { proc setup_kerberos_files { } { global hostname + global domain if ![get_hostname] { return 0 @@ -215,6 +219,10 @@ proc setup_kerberos_files { } { puts $conffile " kdc = $hostname:3088" puts $conffile " admin_server = $hostname:3750" puts $conffile " \}" + puts $conffile "" + puts $conffile "\[domain_realm\]" + puts $conffile " .$domain = KRBTEST.COM" + puts $conffile " $domain = KRBTEST.COM" close $conffile } @@ -730,18 +738,19 @@ proc add_random_key { kkey standalone } { # setup_srvtab # Set up a srvtab file. start_kerberos_daemons and add_random_key -# host/$hostname must be called before this procedure. If the +# $id/$hostname must be called before this procedure. If the # argument is non-zero, call pass at relevant points. Returns 1 on -# success, 0 on failure. +# success, 0 on failure. If the id field is not provided, host is used. -proc setup_srvtab { standalone } { +proc setup_srvtab { standalone {id host} } { global KDB5_EDIT global KEY global tmppwd global hostname global spawn_id + global last_service - if {!$standalone && [file exists tmpdir/srvtab]} { + if {!$standalone && [file exists tmpdir/srvtab] && $last_service == $id} { return 1 } @@ -775,8 +784,8 @@ proc setup_srvtab { standalone } { expect "Enter KDC database master key" send "masterkey$KEY\r" expect "kdb5_edit:" - send "xst $hostname host\r" - expect "'host/$hostname@KRBTEST.COM' added to keytab" + send "xst $hostname $id\r" + expect "'$id/$hostname@KRBTEST.COM' added to keytab" expect "kdb5_edit:" send "quit\r" expect "\r" @@ -804,6 +813,9 @@ proc setup_srvtab { standalone } { # root shell and the srvtab is NFS mounted. catch "exec chmod a+r tmpdir/srvtab" + # Remember what we just extracted + set last_service $id + return 1 }