From 5e8a3b7b558273fa06525f642fdf2d678dde85eb Mon Sep 17 00:00:00 2001 From: Dave Brolley Date: Thu, 3 Sep 2009 16:13:30 -0400 Subject: Allow process begin/end probes for unprivileged users. 2009-09-03 Dave Brolley * tapsets.cxx (visit_cast_op): Don't disallow unprivileged users. Annotate synthesized function with /* unprivileged */. * tapset-utrace.cxx (register_tapset_utrace): Call allow_unprivileged for process begin and end probes. * translate.cxx (translate_pass): Generate '#define STP_PRIVILEGED 1' unless --unprivileged was specified. * runtime/transport/transport.c: Don't define _stp_unprivileged_user. * runtime/task_finder.c (__stp_utrace_attach_match_filename): Check that _stp_uid equals the task euid when STP_PRIVILEGED is not defined. (stap_start_task_finder): Likewise. * runtime/staprun/staprun.c (insert_stap_module): Don't generate module option _stp_unprivileged_user. --- tapset-utrace.cxx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'tapset-utrace.cxx') diff --git a/tapset-utrace.cxx b/tapset-utrace.cxx index 6872c87c..d9d95f82 100644 --- a/tapset-utrace.cxx +++ b/tapset-utrace.cxx @@ -1033,12 +1033,20 @@ register_tapset_utrace(systemtap_session& s) for (unsigned i = 0; i < roots.size(); ++i) { - roots[i]->bind(TOK_BEGIN)->bind(builder); - roots[i]->bind(TOK_END)->bind(builder); - roots[i]->bind(TOK_THREAD)->bind(TOK_BEGIN)->bind(builder); - roots[i]->bind(TOK_THREAD)->bind(TOK_END)->bind(builder); - roots[i]->bind(TOK_SYSCALL)->bind(builder); - roots[i]->bind(TOK_SYSCALL)->bind(TOK_RETURN)->bind(builder); + roots[i]->bind(TOK_BEGIN) + ->allow_unprivileged() + ->bind(builder); + roots[i]->bind(TOK_END) + ->allow_unprivileged() + ->bind(builder); + roots[i]->bind(TOK_THREAD)->bind(TOK_BEGIN) + ->bind(builder); + roots[i]->bind(TOK_THREAD)->bind(TOK_END) + ->bind(builder); + roots[i]->bind(TOK_SYSCALL) + ->bind(builder); + roots[i]->bind(TOK_SYSCALL)->bind(TOK_RETURN) + ->bind(builder); } } -- cgit