From 4d66d71756f43e4cc1a0b31b4228b400a58d795d Mon Sep 17 00:00:00 2001 From: dsmith Date: Wed, 15 Aug 2007 17:37:21 +0000 Subject: 2007-08-15 David Smith * staprun.c (main): Quit if effective uid is not root. --- runtime/staprun/staprun.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'runtime/staprun/staprun.c') 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). */ -- cgit