diff options
author | Josh Stone <jistone@redhat.com> | 2009-04-01 19:41:55 -0700 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2009-04-01 19:41:55 -0700 |
commit | 65ffc3f32328473cb74aa5c7eca7e46bb82bd7fb (patch) | |
tree | 837cf08f146cf5230b9b8f84081efb4e6d0557ae | |
parent | 5717eaeb49421506ed323f8473790aaf74389237 (diff) | |
download | systemtap-steved-65ffc3f32328473cb74aa5c7eca7e46bb82bd7fb.tar.gz systemtap-steved-65ffc3f32328473cb74aa5c7eca7e46bb82bd7fb.tar.xz systemtap-steved-65ffc3f32328473cb74aa5c7eca7e46bb82bd7fb.zip |
Fix the magic run-stap wrappers even more
-rwxr-xr-x | configure | 6 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | run-stap.in | 5 | ||||
-rw-r--r-- | run-stapio.in | 10 | ||||
-rw-r--r-- | run-staprun.in | 13 | ||||
-rwxr-xr-x | run-staprun.sh | 6 |
6 files changed, 19 insertions, 23 deletions
@@ -8124,7 +8124,7 @@ subdirs="$subdirs testsuite" ac_config_files="$ac_config_files run-stap" -ac_config_files="$ac_config_files run-stapio" +ac_config_files="$ac_config_files run-staprun" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -8827,7 +8827,7 @@ do "man/stapprobes.udp.3stap") CONFIG_FILES="$CONFIG_FILES man/stapprobes.udp.3stap" ;; "initscript/systemtap") CONFIG_FILES="$CONFIG_FILES initscript/systemtap" ;; "run-stap") CONFIG_FILES="$CONFIG_FILES run-stap" ;; - "run-stapio") CONFIG_FILES="$CONFIG_FILES run-stapio" ;; + "run-staprun") CONFIG_FILES="$CONFIG_FILES run-staprun" ;; *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 $as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} @@ -9607,7 +9607,7 @@ $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} done ;; "run-stap":F) chmod +x run-stap ;; - "run-stapio":F) chmod +x run-stapio ;; + "run-staprun":F) chmod +x run-staprun ;; esac done # for ac_tag diff --git a/configure.ac b/configure.ac index 5e15539e..9b66a724 100644 --- a/configure.ac +++ b/configure.ac @@ -361,7 +361,7 @@ AC_CONFIG_HEADERS([config.h:config.in]) AC_CONFIG_FILES(Makefile doc/Makefile doc/SystemTap_Tapset_Reference/Makefile stap.1 stapprobes.3stap stapfuncs.3stap stapvars.3stap stapex.3stap staprun.8 stap-server.8 man/stapprobes.iosched.3stap man/stapprobes.netdev.3stap man/stapprobes.nfs.3stap man/stapprobes.nfsd.3stap man/stapprobes.pagefault.3stap man/stapprobes.process.3stap man/stapprobes.rpc.3stap man/stapprobes.scsi.3stap man/stapprobes.signal.3stap man/stapprobes.socket.3stap man/stapprobes.tcp.3stap man/stapprobes.udp.3stap initscript/systemtap) AC_CONFIG_SUBDIRS(testsuite) AC_CONFIG_FILES([run-stap], [chmod +x run-stap]) -AC_CONFIG_FILES([run-stapio], [chmod +x run-stapio]) +AC_CONFIG_FILES([run-staprun], [chmod +x run-staprun]) AC_OUTPUT if test "${prefix}" = "/usr/local"; then diff --git a/run-stap.in b/run-stap.in index f8ee9287..1bfb6a77 100644 --- a/run-stap.in +++ b/run-stap.in @@ -19,9 +19,8 @@ esac # Set all the variables to find the source and build trees. SYSTEMTAP_TAPSET="${srcdir}/tapset" SYSTEMTAP_RUNTIME="${srcdir}/runtime" -SYSTEMTAP_STAPRUN="builddir='$builddir' ${srcdir}/run-staprun.sh" -SYSTEMTAP_STAPIO="${srcdir}/run-stapio" -export SYSTEMTAP_TAPSET SYSTEMTAP_RUNTIME SYSTEMTAP_STAPRUN SYSTEMTAP_STAPIO +SYSTEMTAP_STAPRUN="sudo -P builddir='${builddir}' ${builddir}/run-staprun" +export SYSTEMTAP_TAPSET SYSTEMTAP_RUNTIME SYSTEMTAP_STAPRUN # If there were private elfutils libs built, use them. if [ -d "$rundir/lib-elfutils" ]; then diff --git a/run-stapio.in b/run-stapio.in deleted file mode 100644 index 554c2d33..00000000 --- a/run-stapio.in +++ /dev/null @@ -1,10 +0,0 @@ -#!@PERL@ -w - -# Reset real IDs to those we had before running sudo in run-staprun.sh. -# This gives stapio the IDs it expects from a setuid exec. -$< = $ENV{'SUDO_UID'}; -$( = $ENV{'SUDO_GID'}; - -exec { "$ENV{'builddir'}/stapio" } ('stapio', @ARGV); - -exit; diff --git a/run-staprun.in b/run-staprun.in new file mode 100644 index 00000000..0b5f795b --- /dev/null +++ b/run-staprun.in @@ -0,0 +1,13 @@ +#!@PERL@ -w + +# Reset real IDs to those we had before we were sudo-invoked. +# This gives staprun the IDs it expects from a setuid exec. +$< = $ENV{'SUDO_UID'}; +$( = $ENV{'SUDO_GID'}; + +$ENV{'SYSTEMTAP_STAPRUN'} = "sudo '$ENV{'builddir'}/staprun'"; +$ENV{'SYSTEMTAP_STAPIO'} = "$ENV{'builddir'}/stapio"; + +exec { "$ENV{'builddir'}/staprun" } ('staprun', @ARGV); + +exit; diff --git a/run-staprun.sh b/run-staprun.sh deleted file mode 100755 index 688dfa78..00000000 --- a/run-staprun.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -exec sudo env builddir="${builddir}" \ - SYSTEMTAP_STAPIO="${builddir}/run-stapio" \ - SYSTEMTAP_STAPRUN="$0" \ - "${builddir}/staprun" ${1+"$@"} |