diff options
author | Elliott Baron <ebaron@toriamos.yyz.redhat.com> | 2008-12-05 16:46:32 -0500 |
---|---|---|
committer | Elliott Baron <ebaron@toriamos.yyz.redhat.com> | 2008-12-05 16:46:32 -0500 |
commit | ece3457a5cc92f0968ebf52823af2d017d5272c1 (patch) | |
tree | 45833a5ca9d552032a1d52f005d5e92e1f3ab441 /runtime/staprun/staprun.c | |
parent | 5cf5735849650a89aa3182dfbacd8218ac0f3b9e (diff) | |
parent | 2f62657ce707b4011253d533c0423ed8d49a3e9e (diff) | |
download | systemtap-steved-ece3457a5cc92f0968ebf52823af2d017d5272c1.tar.gz systemtap-steved-ece3457a5cc92f0968ebf52823af2d017d5272c1.tar.xz systemtap-steved-ece3457a5cc92f0968ebf52823af2d017d5272c1.zip |
Merge branch 'master'; commit 'origin/pr6925'
Diffstat (limited to 'runtime/staprun/staprun.c')
-rw-r--r-- | runtime/staprun/staprun.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/runtime/staprun/staprun.c b/runtime/staprun/staprun.c index 9d647675..b568c867 100644 --- a/runtime/staprun/staprun.c +++ b/runtime/staprun/staprun.c @@ -242,6 +242,15 @@ int main(int argc, char **argv) exit(-1); } + if (getuid() != 0) { + rc = unsetenv("SYSTEMTAP_STAPRUN") || + unsetenv("SYSTEMTAP_STAPIO"); + if (rc) { + _perr("unsetenv failed"); + exit(-1); + } + } + setup_signals(); parse_args(argc, argv); @@ -283,7 +292,7 @@ int main(int argc, char **argv) if (init_staprun()) exit(1); - argv[0] = PKGLIBDIR "/stapio"; + argv[0] = getenv ("SYSTEMTAP_STAPIO") ?: PKGLIBDIR "/stapio"; if (run_as (1, getuid(), getgid(), argv[0], argv) < 0) { perror(argv[0]); goto err; @@ -473,4 +482,3 @@ int send_relocations () out: return rc; } - |