From: Tom Yu Date: Tue, 12 Nov 1996 02:24:17 +0000 (+0000) Subject: * init_db, save_files.sh, start_servers_local, stop_servers, X-Git-Tag: krb5-1.0-freeze1~47 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8cf98fe5624ba448f1658ceeb288289446228fdb;p=krb5.git * init_db, save_files.sh, start_servers_local, stop_servers, stop_servers_local: Use temp files rather than a here document to provide input to eval'ed commands; Ultrix sh is broken wrt here documents redirected to eval commands. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9382 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kadmin/testing/scripts/ChangeLog b/src/kadmin/testing/scripts/ChangeLog index 550a628ba..87e77d8d9 100644 --- a/src/kadmin/testing/scripts/ChangeLog +++ b/src/kadmin/testing/scripts/ChangeLog @@ -1,5 +1,10 @@ Mon Nov 11 14:25:15 1996 Tom Yu + * init_db, save_files.sh, start_servers_local, stop_servers, + stop_servers_local: Use temp files rather than a here document to + provide input to eval'ed commands; Ultrix sh is broken wrt here + documents redirected to eval commands. + * start_servers, start_servers_local, init_db: Use ${FOO+bar} and ${FOO=baz} rather than ${FOO:+bar} and ${FOO:=baz} because of Ultrix /bin/sh lossage. diff --git a/src/kadmin/testing/scripts/init_db b/src/kadmin/testing/scripts/init_db index 2b218f001..07d292172 100644 --- a/src/kadmin/testing/scripts/init_db +++ b/src/kadmin/testing/scripts/init_db @@ -69,7 +69,7 @@ kdb5_util -r $REALM create -P mrroot -s $REDIRECT cp $STESTDIR/proto/ovsec_adm.dict $K5ROOT/ovsec_adm.dict -eval $SRVTCL <<'EOF' $REDIRECT +cat - > /tmp/init_db$$ <<\EOF source $env(TCLUTIL) set r $env(REALM) if {[info exists env(USER)]} { @@ -165,6 +165,8 @@ foreach cmd $cmds { } } EOF +eval "$SRVTCL < /tmp/init_db$$ $REDIRECT" +rm /tmp/init_db$$ if [ $? -ne 0 ]; then echo "Error in $SRVTCL!" 1>&2 diff --git a/src/kadmin/testing/scripts/save_files.sh b/src/kadmin/testing/scripts/save_files.sh index b9fc37319..8d0a7c9b3 100644 --- a/src/kadmin/testing/scripts/save_files.sh +++ b/src/kadmin/testing/scripts/save_files.sh @@ -10,9 +10,9 @@ while [ $# -gt 0 ] ; do done # If it's set, set it to true -VERBOSE=${VERBOSE_TEST:+true} +VERBOSE=${VERBOSE_TEST+true} # Otherwise, set it to false -DUMMY=${VERBOSE:=false} +DUMMY=${VERBOSE=false} # files="/etc/inetd.conf /etc/syslog.conf /etc/krb.conf \ # /etc/krb.realms /etc/passwd /etc/services /etc/v5srvtab \ diff --git a/src/kadmin/testing/scripts/start_servers_local b/src/kadmin/testing/scripts/start_servers_local index 83913af0e..e35365963 100644 --- a/src/kadmin/testing/scripts/start_servers_local +++ b/src/kadmin/testing/scripts/start_servers_local @@ -96,7 +96,7 @@ DUMMY=${REALM=SECURE-TEST.OV.COM}; export REALM hostname=`hostname` QUALNAME=`$TOP/testing/scripts/qualname.pl $hostname`; export QUALNAME -eval $SRVTCL <<'EOF' $REDIRECT +cat - > /tmp/start_servers_local$$ <<\EOF source $env(STOP)/testing/tcl/util.t set r $env(REALM) set q $env(QUALNAME) @@ -106,6 +106,8 @@ puts stdout [ovsec_kadm_create_principal $server_handle \ [simple_principal host/$q@$r] {OVSEC_KADM_PRINCIPAL} notathena] puts stdout [ovsec_kadm_destroy $server_handle] EOF +eval "$SRVTCL < /tmp/start_servers_local$$ $REDIRECT" +rm /tmp/start_servers_local$$ # rm -f /etc/v5srvtab # eval $LOCAL_MAKE_KEYTAB -princ host/xCANONHOSTx /etc/v5srvtab $REDIRECT diff --git a/src/kadmin/testing/scripts/stop_servers b/src/kadmin/testing/scripts/stop_servers index e8dcac838..dc59d78bf 100644 --- a/src/kadmin/testing/scripts/stop_servers +++ b/src/kadmin/testing/scripts/stop_servers @@ -18,9 +18,9 @@ DUMMY=${RSH_CMD=rsh} DUMMY=${RESTORE_FILES=$TESTDIR/scripts/restore_files.sh} # If it's set, set it to true -VERBOSE=${VERBOSE_TEST:+true} +VERBOSE=${VERBOSE_TEST+true} # Otherwise, set it to false -DUMMY=${VERBOSE:=false} +DUMMY=${VERBOSE=false} local=1 diff --git a/src/kadmin/testing/scripts/stop_servers_local b/src/kadmin/testing/scripts/stop_servers_local index 5328e97a6..dcc52799e 100644 --- a/src/kadmin/testing/scripts/stop_servers_local +++ b/src/kadmin/testing/scripts/stop_servers_local @@ -4,9 +4,9 @@ DUMMY=${TESTDIR=$TOP/testing} DUMMY=${RESTORE_FILES=$TESTDIR/scripts/restore_files.sh} # If it's set, set it to true -VERBOSE=${VERBOSE_TEST:+true} +VERBOSE=${VERBOSE_TEST+true} # Otherwise, set it to false -DUMMY=${VERBOSE:=false} +DUMMY=${VERBOSE=false} v4files=false while [ $# -gt 0 ] ; do @@ -51,3 +51,4 @@ rm -f /usr/tmp/krb5kdc_rcache if $v4files; then $RESTORE_FILES $start_servers fi +exit 0