Fix LD_LIBRARY_PATH in setup_root_shell()
authorPaul Park <pjpark@mit.edu>
Mon, 19 Jun 1995 17:39:38 +0000 (17:39 +0000)
committerPaul Park <pjpark@mit.edu>
Mon, 19 Jun 1995 17:39:38 +0000 (17:39 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6093 dc483132-0cff-0310-8789-dd5450dbe970

src/tests/dejagnu/config/ChangeLog
src/tests/dejagnu/config/default.exp

index 525b4ad8619bee8513fcb94e67b24cd2144d2f50..99c33b7663649bb987e99c8ecfe1a07f02913c39 100644 (file)
@@ -1,4 +1,7 @@
 
+Mon Jun 19 13:38:27 EDT 1995   Paul Park       (pjpark@mit.edu)
+       * default.exp - Fix setup_root_shell() with LD_LIBRARY_PATH.
+
 Thu Jun 15 18:13:55 EDT 1995   Paul Park       (pjpark@mit.edu)
        * default.exp - Setup and use LD_LIBRARY_PATH, in case we were built
                with shared libraries.
index 1389ad50a7b7afe1e6c8fdd0db52a0aa672ca629..07bbc7bfa151cef91c5fb77f1b93a2f487d624e4 100644 (file)
@@ -312,7 +312,13 @@ proc setup_kerberos_env { } {
     verbose "KERBEROS_SERVER=$env(KERBEROS_SERVER)"
 
     # Tell the dynamic loader where to get our shared libraries
-    set env(LD_LIBRARY_PATH) "$SHLIBDIR"
+    if [info exists env(LD_LIBRARY_PATH)] {
+       set oldpath $env(LD_LIBRARY_PATH)
+       set env(LD_LIBRARY_PATH) "$SHLIBDIR $env(LD_LIBRARY_PATH)"
+    } else {
+       catch "unset oldpath"
+       set env(LD_LIBRARY_PATH) "$SHLIBDIR"
+    }
     verbose "LD_LIBRARY_PATH=$env(LD_LIBRARY_PATH)"
     return 1
 }
@@ -964,6 +970,7 @@ proc setup_root_shell { testname } {
     global rlogin_pid
     global tmppwd
     global env
+    global SHLIBDIR
 
     # Make sure we are using the original values of the environment
     # variables.  This means that the caller must call
@@ -971,6 +978,16 @@ proc setup_root_shell { testname } {
 
     restore_kerberos_env
 
+    # Tell the dynamic loader where to get our shared libraries
+    if [info exists env(LD_LIBRARY_PATH)] {
+       set oldpath $env(LD_LIBRARY_PATH)
+       set env(LD_LIBRARY_PATH) "$SHLIBDIR $env(LD_LIBRARY_PATH)"
+    } else {
+       catch "unset oldpath"
+       set env(LD_LIBRARY_PATH) "$SHLIBDIR"
+    }
+    verbose "LD_LIBRARY_PATH=$env(LD_LIBRARY_PATH)"
+
     if ![get_hostname] {
        return 0
     }
@@ -1077,6 +1094,13 @@ proc setup_root_shell { testname } {
        }
     }
 
+    # Restore old setting of LD_LIBRARY_PATH
+    if [info exists oldpath] {
+       set env(LD_LIBRARY_PATH) $oldpath
+       catch "unset oldpath"
+    } else {
+       catch "unset env(LD_LIBRARY_PATH)"
+    }
     expect_after
 
     return 1