From ba84d4aeaf80956e18c818861a647f0d595300fa Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Tue, 26 Mar 1996 05:43:20 +0000 Subject: [PATCH] * default.exp (start_kerberos_daemons): New methodology for starting KDC so that the KDC will not hang on a full output buffer which is being ignored. (setup_kerberos_files): Enable des3 encryption types. The first problem was seen on Suns where I previously set the logging for the kdc to stderr, and then ignored the output after the server was running. The second exercised the bug that sam just fixed in mixing in the des3 encryption types. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7712 dc483132-0cff-0310-8789-dd5450dbe970 --- src/tests/dejagnu/config/ChangeLog | 7 +++++ src/tests/dejagnu/config/default.exp | 41 ++++++++++++++++++++++++++-- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/src/tests/dejagnu/config/ChangeLog b/src/tests/dejagnu/config/ChangeLog index 73557852a..c89a940c4 100644 --- a/src/tests/dejagnu/config/ChangeLog +++ b/src/tests/dejagnu/config/ChangeLog @@ -1,3 +1,10 @@ +Tue Mar 26 00:38:14 1996 Ezra Peisach + + * default.exp (start_kerberos_daemons): New methodology for + starting KDC so that the KDC will not hang on a full + output buffer which is being ignored. + (setup_kerberos_files): Enable des3 encryption types. + Thu Mar 14 15:20:33 1996 Mark Eichin * default.exp (add_kerberos_key): clarify "lost KDC" text. diff --git a/src/tests/dejagnu/config/default.exp b/src/tests/dejagnu/config/default.exp index a5c1405e4..a01965af5 100644 --- a/src/tests/dejagnu/config/default.exp +++ b/src/tests/dejagnu/config/default.exp @@ -261,6 +261,7 @@ proc setup_kerberos_files { } { set conffile [open tmpdir/krb5.conf w] puts $conffile "\[libdefaults\]" puts $conffile " default_realm = $REALMNAME" + puts $conffile "default_tgs_enctypes = des3-cbc-md5 des-cbc-md5 des-cbc-crc" puts $conffile "" puts $conffile "\[realms\]" puts $conffile " $REALMNAME = \{" @@ -276,7 +277,6 @@ proc setup_kerberos_files { } { puts $conffile " admin_server = STDERR" puts $conffile " admin_server = FILE:$tmppwd/kadmind5.log" puts $conffile " kdc = FILE:$tmppwd/kdc.log" - puts $conffile " kdc = STDERR" puts $conffile " default = FILE:$tmppwd/others.log" close $conffile } @@ -299,7 +299,7 @@ proc setup_kerberos_files { } { puts $conffile " max_renewable_life = 3:00:00" puts $conffile " default_principal_expiration = 99.12.31.23.59.59" puts $conffile " default_principal_flags = -postdateable -forwardable" - puts $conffile " supported_enctypes = des-cbc-crc:normal des:normal des:v4 des:norealm des:onlyrealm" + puts $conffile " supported_enctypes = des-cbc-crc:normal des-cbc-md5:normal des-cbc-crc:v4 des-cbc-md5:norealm des3-cbc-md5:normal" puts $conffile " \}" puts $conffile "" close $conffile @@ -701,17 +701,49 @@ proc start_kerberos_daemons { standalone } { } # Start up the kerberos daemon + # Why are we doing all this with the log file you may ask. + # We need a handle on when the server starts. If we log the output + # of the server to say stderr, then if we stop looking for output, + # buffers will fill and the server will stop working.... + # So, we look to see when a line is added to the log file and then + # check it.. + set kdc_lfile $tmppwd/kdc.log + set retry 30 + + if ![file exists $kdc_lfile] then { + catch [exec touch $kdc_lfile] + catch "exec sleep 1" + } + + set start [file mtime $kdc_lfile] + spawn $KRB5KDC -r $REALMNAME -n set kdc_pid [exp_pid] set kdc_spawn_id $spawn_id + for {set count 0} {$count < $retry} {incr count} { + if { [file mtime $kdc_lfile] != $start } then { + send_user win\r + break; + } + catch "exec sleep 1" + } + + if {$count >= $retry} { + fail "krb5kdc" + stop_kerberos_daemons + return 0 + } + + spawn -open [open "|tail -1 $kdc_lfile"] + expect { "while.*\r" { fail "krb5kdc" stop_kerberos_daemons return 0 } - "commencing operation\r" { } + "commencing operation\n" { } timeout { fail "krb5kdc" stop_kerberos_daemons @@ -724,6 +756,9 @@ proc start_kerberos_daemons { standalone } { } } + # And cleanup for the tail -1... + wait + if {$standalone} { pass "krb5kdc" } -- 2.26.2