summaryrefslogtreecommitdiffstats
path: root/runtime/staprun/staprun.c
diff options
context:
space:
mode:
authordsmith <dsmith>2007-08-15 17:37:21 +0000
committerdsmith <dsmith>2007-08-15 17:37:21 +0000
commit4d66d71756f43e4cc1a0b31b4228b400a58d795d (patch)
tree0af9086399f8caaceeacdd1bd6e52102925a8831 /runtime/staprun/staprun.c
parent52e5362b44d3bda289778e5304d4597b772af8d7 (diff)
downloadsystemtap-steved-4d66d71756f43e4cc1a0b31b4228b400a58d795d.tar.gz
systemtap-steved-4d66d71756f43e4cc1a0b31b4228b400a58d795d.tar.xz
systemtap-steved-4d66d71756f43e4cc1a0b31b4228b400a58d795d.zip
2007-08-15 David Smith <dsmith@redhat.com>
* staprun.c (main): Quit if effective uid is not root.
Diffstat (limited to 'runtime/staprun/staprun.c')
-rw-r--r--runtime/staprun/staprun.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime/staprun/staprun.c b/runtime/staprun/staprun.c
index fe55e36f..71039e0b 100644
--- a/runtime/staprun/staprun.c
+++ b/runtime/staprun/staprun.c
@@ -154,8 +154,14 @@ int main(int argc, char **argv)
exit(1);
}
+ if (geteuid() != 0) {
+ err("ERROR: The effective user ID of staprun must be set to the root user.\n"
+ " Check permissions on staprun and ensure it is a setuid root program.\n");
+ exit(1);
+ }
+
if (!init_cap())
- return 1;
+ exit(1);
/* Get rid of a few standard environment variables (which */
/* might cause us to do unintended things). */