From 8808f5363b1a3872a5e19ce1197d26e1d8aea5a1 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Wed, 4 Feb 2009 03:18:04 +0000 Subject: [PATCH] remove some krb4 testing hooks git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21878 dc483132-0cff-0310-8789-dd5450dbe970 --- src/config/pre.in | 3 - src/kadmin/testing/scripts/Makefile.in | 10 +- src/kadmin/testing/scripts/env-setup.shin | 4 - .../testing/scripts/fixup-conf-files.plin | 344 ------------------ src/kadmin/testing/scripts/save_files.sh | 62 ---- src/kadmin/testing/scripts/start_servers | 2 - .../testing/scripts/start_servers_local | 16 - src/kadmin/testing/scripts/stop_servers | 2 - src/kadmin/testing/scripts/stop_servers_local | 9 - 9 files changed, 3 insertions(+), 449 deletions(-) delete mode 100755 src/kadmin/testing/scripts/fixup-conf-files.plin delete mode 100755 src/kadmin/testing/scripts/save_files.sh diff --git a/src/config/pre.in b/src/config/pre.in index 55ca53b14..7a4e2ca4f 100644 --- a/src/config/pre.in +++ b/src/config/pre.in @@ -230,12 +230,9 @@ KRB5_INCSUBDIRS = \ TESTDIR = $(BUILDTOP)/kadmin/testing STESTDIR = $(SRCTOP)/kadmin/testing COMPARE_DUMP = $(TESTDIR)/scripts/compare_dump.pl -FIX_CONF_FILES = $(TESTDIR)/scripts/fixup-conf-files.pl INITDB = $(STESTDIR)/scripts/init_db MAKE_KEYTAB = $(TESTDIR)/scripts/make-host-keytab.pl LOCAL_MAKE_KEYTAB= $(TESTDIR)/scripts/make-host-keytab.pl -RESTORE_FILES = $(STESTDIR)/scripts/restore_files.sh -SAVE_FILES = $(STESTDIR)/scripts/save_files.sh ENV_SETUP = $(TESTDIR)/scripts/env-setup.sh CLNTTCL = $(TESTDIR)/util/ovsec_kadm_clnt_tcl SRVTCL = $(TESTDIR)/util/ovsec_kadm_srv_tcl diff --git a/src/kadmin/testing/scripts/Makefile.in b/src/kadmin/testing/scripts/Makefile.in index 6161b1db8..5622fc571 100644 --- a/src/kadmin/testing/scripts/Makefile.in +++ b/src/kadmin/testing/scripts/Makefile.in @@ -6,10 +6,10 @@ PERL_PATH=@PERL_PATH@ .SUFFIXES: .plin .pl -GEN_SCRIPTS = compare_dump.pl fixup-conf-files.pl make-host-keytab.pl \ +GEN_SCRIPTS = compare_dump.pl make-host-keytab.pl \ simple_dump.pl verify_xrunner_report.pl qualname.pl -all:: env-setup.sh $(GEN_SCRIPTS) restore_files.sh +all:: env-setup.sh $(GEN_SCRIPTS) # Should only rebuild env_setup.sh here (use CONFIG_FILES=), but the weird krb5 # makefile post-processing is unconditional and would trash the makefile. @@ -22,10 +22,6 @@ env-setup.stamp: $(srcdir)/env-setup.shin $(thisconfigdir)/config.status \ chmod +x env-setup.sh touch env-setup.stamp -restore_files.sh: - rm -f restore_files.sh - ln -s $(srcdir)/save_files.sh restore_files.sh - .plin.pl: -rm -f $@.tmp echo "#!$(PERL_PATH)" > $@.tmp @@ -34,4 +30,4 @@ restore_files.sh: mv $@.tmp $@ clean:: - -rm -f $(GEN_SCRIPTS) *.tmp env-setup.sh env-setup.stamp restore_files.sh + -rm -f $(GEN_SCRIPTS) *.tmp env-setup.sh env-setup.stamp diff --git a/src/kadmin/testing/scripts/env-setup.shin b/src/kadmin/testing/scripts/env-setup.shin index 03e6d065e..7750e5272 100755 --- a/src/kadmin/testing/scripts/env-setup.shin +++ b/src/kadmin/testing/scripts/env-setup.shin @@ -66,14 +66,10 @@ if test x$EXPECT = x; then fi COMPARE_DUMP=$TESTDIR/scripts/compare_dump.pl; export COMPARE_DUMP -FIX_CONF_FILES=$TESTDIR/scripts/fixup-conf-files.pl -export FIX_CONF_FILES INITDB=$STESTDIR/scripts/init_db; export INITDB MAKE_KEYTAB=$TESTDIR/scripts/make-host-keytab.pl; export MAKE_KEYTAB LOCAL_MAKE_KEYTAB=$TESTDIR/scripts/make-host-keytab.pl export LOCAL_MAKE_KEYTAB -RESTORE_FILES=$TESTDIR/scripts/restore_files.sh; export RESTORE_FILES -SAVE_FILES=$STESTDIR/scripts/save_files.sh; export SAVE_FILES SIMPLE_DUMP=$TESTDIR/scripts/simple_dump.pl; export SIMPLE_DUMP QUALNAME=$TESTDIR/scripts/qualname.pl; export QUALNAME TCLUTIL=$STESTDIR/tcl/util.t; export TCLUTIL diff --git a/src/kadmin/testing/scripts/fixup-conf-files.plin b/src/kadmin/testing/scripts/fixup-conf-files.plin deleted file mode 100755 index d7834d1c7..000000000 --- a/src/kadmin/testing/scripts/fixup-conf-files.plin +++ /dev/null @@ -1,344 +0,0 @@ -#!/usr/local/bin/perl -# -# Usage: fixup-conf-files.pl [-server hostname] - -$verbose = $ENV{'VERBOSE_TEST'}; -$archos = $ENV{'ARCH_OS'}; - -$REALM = "SECURE-TEST.OV.COM"; - -sub replace { - local($old, $new, $backup) = @_; - local($dev, $ino, $mode); - - $new = $old.".new" if !$new; - $backup = $old.".bak" if !$backup; - - chmod($mode,$new) if (($dev, $ino, $mode) = stat($old)); - - unlink($backup); - link($old, $backup) || die "couldn't make backup link: $backup: $!\n" - if -e $old; - rename($new, $old) || die "couldn't rename $old to $new: $!\n"; -} - -if (@ARGV == 2 && $ARGV[0] eq "-server") { - $servername = $ARGV[1]; -} elsif (@ARGV != 0) { - print STDERR "Usage: $0 fixup-conf-files.pl [-server hostname]\n"; -} - -sub canonicalize_name { - local($hostname) = @_; - local($d, $addr, $addrtype); - - ($host,$d,$addrtype,$d,$addr) = gethostbyname($hostname); - die "couldn't get hostname $hostname\n" if !$host; - ($host) = gethostbyaddr($addr,$addrtype); - die "couldn't reverse-resolve $hostname\n" if !$host; - return $host; -} - -## Get server's canonical hostname. -if ($servername) { - $serverhost = $servername; -} else { - chop ($serverhost = `hostname`); -} -$serverhost = &canonicalize_name($serverhost); - -## Get local canonical hostname -chop($localhost=`hostname`); -$localhost = &canonicalize_name($localhost); - -## parse krb.conf - -if (open(KCONF, "/etc/athena/krb.conf")) { - chop($hrealm = ); - - $confok = 0; - - while() { - $confs .= $_ if !/^$REALM\s+/o; - $confok = 1 if /^$REALM\s+$serverhost\s+admin\s+server$/oi; - } - - close(KCONF); -} - -## rewrite krb.conf if necessary. - -if (($hrealm ne $REALM) || !$confok) { - print "Rewriting /etc/athena/krb.conf...\n" if $verbose; - - open(KCONF, ">/etc/athena/krb.conf.new") || - die "couldn't open /etc/athena/krb.conf.new: $!\n"; - - print KCONF "$REALM\n"; - print KCONF "$REALM $serverhost admin server\n"; - print KCONF $confs; - - close(KCONF); - - &replace("/etc/athena/krb.conf"); -} - -## parse krb.realms - -if (open(KREALMS, "/etc/athena/krb.realms")) { - $serverrealmok = 0; - $localrealmok = 0; - - while() { - $realms .= $_ - if !/^$serverhost\s+$REALM$/oi && !/^$localhost\s+$REALM$/oi; - $serverrealmok = 1 if /^$serverhost\s+$REALM$/oi; - $localrealmok = 1 if /^$localhost\s+$REALM$/oi; - } - - close(KREALMS); -} - -## rewrite krb.realms if necessary. - -if (!$serverrealmok || !$localrealmok) { - print "Rewriting /etc/athean/krb.realms...\n" if $verbose; - - open(KREALMS, ">/etc/athena/krb.realms.new") || - die "couldn't open /etc/athena/krb.realms.new: $!\n"; - - print KREALMS "$serverhost $REALM\n"; - print KREALMS "$localhost $REALM\n" if ($localhost ne $serverhost); - print KREALMS $realms; - - close(KREALMS); - - &replace("/etc/athena/krb.realms"); -} - -# ## read /etc/passwd -# -# open(PASSWD, "/etc/passwd") || die "couldn't open /etc/passwd: $!\n"; -# -# $passok = 0; -# -# if ($archos ne "solaris2.3") { -# %mypass = -# ( -# "root", crypt("testroot","St"), -# "testenc", crypt("notath","HJ"), -# "testuser", "KERBEROS5", -# "pol1", "KERBEROS5", -# "pol2", "KERBEROS5", -# "pol3", "KERBEROS5", -# ); -# } else { -# %mypass = -# ( -# "root", "x", -# "testenc", "x", -# "testuser", "x", -# "pol1", "x", -# "pol2", "x", -# "pol3", "x", -# ); -# %myshadow = -# ( -# "root", crypt("testroot","St"), -# "testenc", crypt("notath","HJ"), -# "testuser", "KERBEROS5", -# "pol1", "KERBEROS5", -# "pol2", "KERBEROS5", -# "pol3", "KERBEROS5", -# ); -# } -# -# $chpw = 0; -# -# while() { -# if (/^([^:]+):([^:]+):/ && $mypass{$1}) { -# $users{$1}++; -# if ($2 ne $mypass{$1}) { -# s/^([^:]+):([^:]+):/$1:$mypass{$1}:/; -# $chpw++; -# } -# } -# $pass .= $_; -# } -# -# $passok = 1; -# -# for (keys %mypass) { -# if (!$users{$_}) { -# $pass .= "$_:$mypass{$_}:32765:101::/tmp:/bin/csh\n"; -# $passok = 0; -# } -# } -# close(PASSWD); -# -# ## rewrite passwd if necessary. -# -# if ($chpw || !$passok) { -# print "Rewriting /etc/passwd...\n" if $verbose; -# -# open(PASSWD, ">/etc/passwd.new") || -# die "couldn't open /etc/passwd.new: $!\n"; -# -# print PASSWD $pass; -# -# close(PASSWD); -# -# &replace("/etc/passwd"); -# } -# -# if ($archos eq "solaris2.3") { -# -# ## read /etc/shadow -# -# open(SHADOW, "/etc/shadow") || die "couldn't open /etc/shadow: $!\n"; -# -# $shadowok = 0; -# $chpw = 0; -# %users = (); -# -# while() { -# if (/^([^:]+):([^:]+):/ && $myshadow{$1}) { -# $users{$1}++; -# if ($2 ne $myshadow{$1}) { -# s/^([^:]+):([^:]+):/$1:$myshadow{$1}:/; -# $chpw++; -# } -# } -# $shadow .= $_; -# } -# -# $shadowok = 1; -# -# for (keys %myshadow) { -# if (!$users{$_}) { -# $shadow .= "$_:$myshadow{$_}:6445::::::\n"; -# $shadowok = 0; -# } -# } -# close(SHADOW); -# -# ## rewrite shadow if necessary. -# -# if ($chpw || !$shadowok) { -# print "Rewriting /etc/shadow...\n" if $verbose; -# -# open(SHADOW, ">/etc/shadow.new") || -# die "couldn't open /etc/shadow.new: $!\n"; -# -# print SHADOW $shadow; -# -# close(SHADOW); -# -# &replace("/etc/shadow"); -# } -# } -# -# if ($archos eq "aix3.2") { -# -# ## read /etc/security/passwd -# -# open(SHADOW, "/etc/security/passwd") || die "couldn't open /etc/security/passwd: $!\n"; -# -# $shadowok = 0; -# %users = (); -# -# while() { -# if (/^([^:]+):\s*$/ && $mypass{$1}) { -# $user = $1; -# $users{$user}++; -# # arrange for the user to have a password entry and none other -# while () { -# last if (!/=/); -# } -# $shadow .= "$user:\n\tpassword = KERBEROS5\n\n"; -# } else { -# $shadow .= $_; -# } -# } -# -# $shadowok = 1; -# -# for (keys %mypass) { -# if (!$users{$_}) { -# $shadow .= "$_:\n\tpassword = KERBEROS5\n\n"; -# $shadowok = 0; -# } -# } -# close(SHADOW); -# -# ## rewrite shadow if necessary. -# -# if (!$shadowok) { -# print "Rewriting /etc/security/passwd...\n" if $verbose; -# -# open(SHADOW, ">/etc/security/passwd.new") || -# die "couldn't open /etc/security/passwd.new: $!\n"; -# -# print SHADOW $shadow; -# -# close(SHADOW); -# -# &replace("/etc/security/passwd"); -# } -# } -# -# open(SERVICES, "/etc/services") || die "couldn't open /etc/services: $!\n"; -# open(NEW_SERVICES, ">/etc/services.new") || -# die "couldn't open /etc/services.new: $!\n"; -# -# print "Rewriting /etc/services...\n" if $verbose; -# -# @needed_services = ('klogin', 'kshell', 'kerberos', 'kerberos-sec', -# 'kerberos5', 'kerberos4', 'kerberos_master', -# 'passwd_server', 'eklogin', 'krb5_prop', -# 'kerberos_adm', 'kerberos-adm'); -# for (@needed_services) { -# $needed_services{$_}++; -# } -# -# while () { -# m/^\s*([^\#\s][^\s]+)/; -# if ($needed_services{$1}) { -# print "+ Commenting out old entry: $1\n" if $verbose; -# print NEW_SERVICES "# $_"; -# } else { -# print NEW_SERVICES $_; -# } -# } -# -# close(SERVICES); -# -# print NEW_SERVICES <&2 - fi - else - if cp $f.pre-secure $f; then - rm $f.pre-secure - else - echo "Warning! cp failed!" 1>&2 - fi - fi - fi -done - -# DUMMY=${INETD:=/etc/inetd} -# if $VERBOSE; then -# echo "Killing and restarting $INETD" -# fi -# kill `$PS_ALL | awk '/inetd/ && !/awk/ {print $2}'` -# $INETD diff --git a/src/kadmin/testing/scripts/start_servers b/src/kadmin/testing/scripts/start_servers index b59d97b91..80cf8d6f4 100755 --- a/src/kadmin/testing/scripts/start_servers +++ b/src/kadmin/testing/scripts/start_servers @@ -11,8 +11,6 @@ DUMMY=${TESTDIR=$TOP/testing} DUMMY=${STESTDIR=$STOP/testing} -DUMMY=${SAVE_FILES=$STESTDIR/scripts/save_files.sh} -DUMMY=${FIX_CONF_FILES=$TESTDIR/scripts/fixup-conf-files.pl} DUMMY=${START_SERVERS_LOCAL=$STESTDIR/scripts/start_servers_local} # This'll be wrong sometimes DUMMY=${RSH_CMD=rsh} diff --git a/src/kadmin/testing/scripts/start_servers_local b/src/kadmin/testing/scripts/start_servers_local index 5c1df4c26..75b55ec19 100755 --- a/src/kadmin/testing/scripts/start_servers_local +++ b/src/kadmin/testing/scripts/start_servers_local @@ -2,8 +2,6 @@ DUMMY=${TESTDIR=$TOP/testing} DUMMY=${STESTDIR=$STOP/testing} -DUMMY=${SAVE_FILES=$STESTDIR/scripts/save_files.sh} -DUMMY=${FIX_CONF_FILES=$TESTDIR/scripts/fixup-conf-files.pl} DUMMY=${INITDB=$STESTDIR/scripts/init_db} DUMMY=${SRVTCL=$TESTDIR/util/ovsec_kadm_srv_tcl}; export SRVTCL DUMMY=${LOCAL_MAKE_KEYTAB=$TESTDIR/scripts/make-host-keytab.pl} @@ -24,7 +22,6 @@ else REDIRECT='>/dev/null' fi -v4files=false while :; do case $1 in -keysalt) @@ -43,13 +40,6 @@ while :; do break fi ;; - -v4files) - if [ "`whoami`" != "root" ]; then - echo "You must be root to use -v4files!" 1>&2 - exit 1 - fi - v4files=true - ;; *) break ;; @@ -65,12 +55,6 @@ elif [ $# = 1 ]; then export TOP fi -# fixup the system config files -if $v4files; then - $SAVE_FILES || exit 1 - $FIX_CONF_FILES || exit 1 -fi - # create a fresh db $INITDB "$keysalts" || exit 1 diff --git a/src/kadmin/testing/scripts/stop_servers b/src/kadmin/testing/scripts/stop_servers index 9542fada8..b7f8384ca 100755 --- a/src/kadmin/testing/scripts/stop_servers +++ b/src/kadmin/testing/scripts/stop_servers @@ -11,11 +11,9 @@ DUMMY=${TESTDIR=$TOP/testing} DUMMY=${STESTDIR=$STOP/testing} -DUMMY=${FIX_CONF_FILES=$TESTDIR/scripts/fixup-conf-files.pl} DUMMY=${STOP_SERVERS_LOCAL=$STESTDIR/scripts/stop_servers_local} # This'll be wrong sometimes DUMMY=${RSH_CMD=rsh} -DUMMY=${RESTORE_FILES=$TESTDIR/scripts/restore_files.sh} local=1 diff --git a/src/kadmin/testing/scripts/stop_servers_local b/src/kadmin/testing/scripts/stop_servers_local index 15700f501..24a9de7b3 100755 --- a/src/kadmin/testing/scripts/stop_servers_local +++ b/src/kadmin/testing/scripts/stop_servers_local @@ -1,18 +1,13 @@ #!/bin/sh DUMMY=${TESTDIR=$TOP/testing} -DUMMY=${RESTORE_FILES=$TESTDIR/scripts/restore_files.sh} DUMMY=${KRB5RCACHEDIR=$TESTDIR} -v4files=false while [ $# -gt 0 ] ; do case $1 in -start_servers) start_servers=$1 ;; - -v4files) - v4files=true - ;; *) TOP=$1 export TOP @@ -46,8 +41,4 @@ if test "x$USER" = x ; then fi rm -f $KRB5RCACHEDIR/krb5kdc_rcache.$USER -# restore saved system config files -if $v4files; then - $RESTORE_FILES $start_servers -fi exit 0 -- 2.26.2