diff options
author | ananth <ananth> | 2008-02-04 09:30:48 +0000 |
---|---|---|
committer | ananth <ananth> | 2008-02-04 09:30:48 +0000 |
commit | 5e31adfd421713a07d537aa30e93493e5d0a54c6 (patch) | |
tree | 567900c49e04f7ee7700d867d1e88f7b616ff168 /runtime/staprun/staprun_funcs.c | |
parent | d2995e6f6ec8475e1c6c0bb603da4244921ddec7 (diff) | |
download | systemtap-steved-5e31adfd421713a07d537aa30e93493e5d0a54c6.tar.gz systemtap-steved-5e31adfd421713a07d537aa30e93493e5d0a54c6.tar.xz systemtap-steved-5e31adfd421713a07d537aa30e93493e5d0a54c6.zip |
Print out more descriptive error messages on non-root systemtap invocation
Thanks to Jim for fixing typos and grammar.
Diffstat (limited to 'runtime/staprun/staprun_funcs.c')
-rw-r--r-- | runtime/staprun/staprun_funcs.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/runtime/staprun/staprun_funcs.c b/runtime/staprun/staprun_funcs.c index d1bba3f8..3a678405 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; } |