environment variables and the exec program.
This allows for easy testing of "rsh $hostname klist" which would
normally fail due to shared libraries not being setup.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7902
dc483132-0cff-0310-8789-
dd5450dbe970
+Mon May 6 11:54:20 1996 Ezra Peisach <epeisach@kangaroo.mit.edu>
+
+ * default.exp: Add procedure setup_wrapper to first setup shared
+ library environment variables and the exec program
+
Sat May 4 11:56:17 1996 Ezra Peisach (epeisach@kangaroo.mit.edu)
* default.exp: For stty_init set to \^h as on some /bin/sh, ^ is
proc tail1 { file } {
exec tail -1 $file
}
+
+# setup_wrapper
+# Sets up a wraper script to set the runtime shared library environment
+# variables and then executes a specific command. This is used to allow
+# a "rsh klist" or telnetd to execute login.krb5.
+proc setup_wrapper { file command } {
+ global BINSH
+ global env
+ global krb5_init_vars
+
+ # We will start with a BINSH script
+ catch "exec rm -f $file"
+
+ set f [open $file "w" 0777]
+ puts $f "#!$BINSH"
+ foreach i $krb5_init_vars {
+ regexp "^(\[^=\]*)=(.*)" $i foo evar evalue
+ puts $f "$evar=$env($evar)"
+ puts $f "export $evar"
+ }
+ puts $f "exec $command"
+ close $f
+
+ return 1
+}
+
+