remove some krb4 testing hooks
authorKen Raeburn <raeburn@mit.edu>
Wed, 4 Feb 2009 03:18:04 +0000 (03:18 +0000)
committerKen Raeburn <raeburn@mit.edu>
Wed, 4 Feb 2009 03:18:04 +0000 (03:18 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21878 dc483132-0cff-0310-8789-dd5450dbe970

src/config/pre.in
src/kadmin/testing/scripts/Makefile.in
src/kadmin/testing/scripts/env-setup.shin
src/kadmin/testing/scripts/fixup-conf-files.plin [deleted file]
src/kadmin/testing/scripts/save_files.sh [deleted file]
src/kadmin/testing/scripts/start_servers
src/kadmin/testing/scripts/start_servers_local
src/kadmin/testing/scripts/stop_servers
src/kadmin/testing/scripts/stop_servers_local

index 55ca53b14460d0336716dc94208b3b600fbfdc5a..7a4e2ca4faa61fc2652ab0033eda9b51e7a41a47 100644 (file)
@@ -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
index 6161b1db85c2a8254e3500adb991ea3b981d8d14..5622fc5719d3ee6898925a2fe575241109e5e72c 100644 (file)
@@ -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
index 03e6d065e293e41ffae25abae073f821f87f1261..7750e52725a3871124d8947f9ebe7063c3c82e42 100755 (executable)
@@ -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 (executable)
index d7834d1..0000000
+++ /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 (executable)
index 7218203..0000000
+++ /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
index b59d97b918e04231eb57bbaadbc0d8d3a43cd560..80cf8d6f4eaa8ae5115839d9ee62baaddb053a65 100755 (executable)
@@ -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}
index 5c1df4c2652a9579f7d8b1b88ba8f8471ea0deee..75b55ec19db62535edcd2cecb2c8eaba5ae0dbc9 100755 (executable)
@@ -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
index 9542fada8499680c08e74e736713c71df79ac354..b7f8384cacccd523592c0c814bfb119a056aa4f5 100755 (executable)
 
 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
 
index 15700f50117cb7c8a86a3a4f0935737b68118c69..24a9de7b39daecba98cc8b5914307018b3ece679 100755 (executable)
@@ -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