diff options
| author | Ken Raeburn <raeburn@mit.edu> | 2009-02-04 03:18:04 +0000 |
|---|---|---|
| committer | Ken Raeburn <raeburn@mit.edu> | 2009-02-04 03:18:04 +0000 |
| commit | 8808f5363b1a3872a5e19ce1197d26e1d8aea5a1 (patch) | |
| tree | 87047d03bf12844233f5d2d5f69d10b04ec59427 /src/kadmin/testing | |
| parent | 268b30402d3ecca4e0b7a01a809f110f0f2fc15c (diff) | |
| download | krb5-8808f5363b1a3872a5e19ce1197d26e1d8aea5a1.tar.gz krb5-8808f5363b1a3872a5e19ce1197d26e1d8aea5a1.tar.xz krb5-8808f5363b1a3872a5e19ce1197d26e1d8aea5a1.zip | |
remove some krb4 testing hooks
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21878 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/kadmin/testing')
| -rw-r--r-- | src/kadmin/testing/scripts/Makefile.in | 10 | ||||
| -rwxr-xr-x | src/kadmin/testing/scripts/env-setup.shin | 4 | ||||
| -rwxr-xr-x | src/kadmin/testing/scripts/fixup-conf-files.plin | 344 | ||||
| -rwxr-xr-x | src/kadmin/testing/scripts/save_files.sh | 62 | ||||
| -rwxr-xr-x | src/kadmin/testing/scripts/start_servers | 2 | ||||
| -rwxr-xr-x | src/kadmin/testing/scripts/start_servers_local | 16 | ||||
| -rwxr-xr-x | src/kadmin/testing/scripts/stop_servers | 2 | ||||
| -rwxr-xr-x | src/kadmin/testing/scripts/stop_servers_local | 9 |
8 files changed, 3 insertions, 446 deletions
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 = <KCONF>); - - $confok = 0; - - while(<KCONF>) { - $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(<KREALMS>) { - $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(<PASSWD>) { -# 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(<SHADOW>) { -# 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(<SHADOW>) { -# if (/^([^:]+):\s*$/ && $mypass{$1}) { -# $user = $1; -# $users{$user}++; -# # arrange for the user to have a password entry and none other -# while (<SHADOW>) { -# 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 (<SERVICES>) { -# 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 <<EOF || die "writing to /etc/services.new: $!\n"; -# -# klogin 543/tcp # Kerberos authenticated rlogin -# kshell 544/tcp cmd # and remote shell -# kerberos 88/udp kdc # Kerberos authentication--udp -# kerberos 88/tcp kdc # Kerberos authentication--tcp -# kerberos-sec 750/udp # Kerberos authentication--udp -# kerberos-sec 750/tcp # Kerberos authentication--tcp -# kerberos5 88/udp kdc # Kerberos authentication--udp -# kerberos5 88/tcp kdc # Kerberos authentication--tcp -# kerberos4 750/udp # Kerberos authentication--udp -# kerberos4 750/tcp # Kerberos authentication--tcp -# kerberos_master 751/udp # Kerberos authentication -# kerberos_master 751/tcp # Kerberos authentication -# passwd_server 752/udp # Kerberos passwd server -# eklogin 2105/tcp # Kerberos encrypted rlogin -# krb5_prop 754/tcp # Kerberos slave propagation -# kerberos_adm 752/tcp # Kerberos 5 admin/changepw -# kerberos-adm 752/tcp # Kerberos 5 admin/changepw -# EOF -# -# close(NEW_SERVICES) || die "error closing /etc/services.new: $!\n"; -# -# rename("/etc/services", "/etc/services.old") || -# die "couldn't rename /etc/services to /etc/services.old: $!\n"; -# rename("/etc/services.new", "/etc/services") || -# die "couldn't rename /etc/services.new to /etc/services: $!\n"; -# unlink("/etc/services.old") || die "couldn't unlink /etc/services: $!\n"; -# diff --git a/src/kadmin/testing/scripts/save_files.sh b/src/kadmin/testing/scripts/save_files.sh deleted file mode 100755 index 72182036f..000000000 --- a/src/kadmin/testing/scripts/save_files.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/sh - -while [ $# -gt 0 ] ; do - case $1 in - -start_servers) - start_servers=$1 - ;; - esac - shift -done - -# files="/etc/inetd.conf /etc/syslog.conf /etc/krb.conf \ -# /etc/krb.realms /etc/passwd /etc/services /etc/v5srvtab \ -# /etc/rc.local /etc/shadow /etc/security/passwd /.k5login \ -# /.secure/etc/passwd /etc/athena/inetd.conf" - -files="/etc/krb.conf /etc/krb.realms /etc/athena/krb.conf \ - /etc/athena/krb.realms /etc/v5srvtab /etc/krb5.keytab" - -name=`basename $0` - -make_dne_name() -{ - dne_name="/tmp/"`echo $1 | sed -e 's,/,#,g'`".did-not-exist" -} - -for f in $files ; do - if [ "$name" = "save_files.sh" ]; then - if [ -f $f.pre-secure ]; then - if $VERBOSE; then - echo "Warning! $f.pre-secure exists, not saving." - fi - elif [ ! -f $f ]; then - make_dne_name $f - cp /dev/null $dne_name - else - cp $f $f.pre-secure - fi - else - make_dne_name $f - if [ -f $dne_name ]; then - rm -f $f $dne_name - elif [ ! -f $f.pre-secure ]; then - if [ "x$start_servers" = "x" ]; then - echo "Warning! $f.pre-secure does not exist!" 1>&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 |
