From 5e31adfd421713a07d537aa30e93493e5d0a54c6 Mon Sep 17 00:00:00 2001 From: ananth Date: Mon, 4 Feb 2008 09:30:48 +0000 Subject: [PATCH] Print out more descriptive error messages on non-root systemtap invocation Thanks to Jim for fixing typos and grammar. --- runtime/staprun/staprun_funcs.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/runtime/staprun/staprun_funcs.c b/runtime/staprun/staprun_funcs.c index d1bba3f87..3a6784058 100644 --- a/runtime/staprun/staprun_funcs.c +++ b/runtime/staprun/staprun_funcs.c @@ -336,7 +336,11 @@ int check_permissions(void) /* If neither group was found, just return an error. */ if (stapdev_gid == (gid_t)-1 && stapusr_gid == (gid_t)-1) { - err("ERROR: unable to find either group \"stapdev\" or group \"stapusr\"\n"); + err("ERROR: You are trying to run stap as a normal user.\n" + "You should either be root, or be part of either " + "group \"stapdev\" or group \"stapusr\".\n" + "Your system doesn't seem to have either group.\n" + "For more information, please consult the \"SAFETY AND SECURITY\" section of the \"stap(1)\" manpage\n"); return -1; } @@ -374,7 +378,10 @@ int check_permissions(void) /* If path_check is 0, then the user isn't a member of either * group. Error out. */ if (path_check == 0) { - err("ERROR: you must be a member of either group \"stapdev\" or group \"stapusr\"\n"); + err("ERROR: You are trying to run stap as a normal user.\n" + "You must be a member of either group \"stapdev\" or group \"stapusr\".\n" + "Please contact your system administrator to get yourself membership to either of those groups.\n" + "For more information, please consult the \"SAFETY AND SECURITY\" section of the \"stap(1)\" manpage.\n"); return 0; } -- 2.43.5