diff options
-rw-r--r-- | runtime/staprun/ChangeLog | 4 | ||||
-rw-r--r-- | runtime/staprun/staprun.c | 8 |
2 files changed, 11 insertions, 1 deletions
diff --git a/runtime/staprun/ChangeLog b/runtime/staprun/ChangeLog index 0ca8812d..dd3eb90e 100644 --- a/runtime/staprun/ChangeLog +++ b/runtime/staprun/ChangeLog @@ -1,3 +1,7 @@ +2007-08-15 David Smith <dsmith@redhat.com> + + * staprun.c (main): Quit if effective uid is not root. + 2007-08-15 Martin Hunt <hunt@redhat.com> PR4736 * staprun.c (cleanup): Set priority back to normal 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). */ |