diff options
author | Dave Brolley <brolley@redhat.com> | 2009-06-11 11:58:55 -0400 |
---|---|---|
committer | Dave Brolley <brolley@redhat.com> | 2009-06-11 11:58:55 -0400 |
commit | b12c8986778619db5bec0a5e52f2d49247e6b5ba (patch) | |
tree | b5136adab377bb897ca7d132b1807487c19d61db /translate.cxx | |
parent | 36b66efaae572dddcfb04e9a995ca69063d0e1ff (diff) | |
download | systemtap-steved-b12c8986778619db5bec0a5e52f2d49247e6b5ba.tar.gz systemtap-steved-b12c8986778619db5bec0a5e52f2d49247e6b5ba.tar.xz systemtap-steved-b12c8986778619db5bec0a5e52f2d49247e6b5ba.zip |
Only sign modules if --unprivileged is specified.
Don't generate an error message for unsigned modules.
Make sure module signature exists before attempting to copy to the cache.
Allow timer p[robes for unprivileged users.
Diffstat (limited to 'translate.cxx')
-rw-r--r-- | translate.cxx | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/translate.cxx b/translate.cxx index 0ef790db..060013bb 100644 --- a/translate.cxx +++ b/translate.cxx @@ -66,7 +66,6 @@ struct c_unparser: public unparser, public visitor void emit_global_init (vardecl* v); void emit_global_param (vardecl* v); void emit_functionsig (functiondecl* v); - void emit_unprivileged_user_check (); void emit_module_init (); void emit_module_exit (); void emit_function (functiondecl* v); @@ -1089,30 +1088,6 @@ c_unparser::emit_functionsig (functiondecl* v) void -c_unparser::emit_unprivileged_user_check () -{ - // If the --unprivileged option was specified then the module - // will be safe for unprivileged users, if it is successfully generated, - // so no check need be emitted. - if (session->unprivileged) - return; - - // Otherwise, generate code to check whether the user is unprivileged. - // If so, then generate an error and indicate that the check has failed. - o->newline(); - o->newline() << "static int systemtap_unprivileged_user_check (void) {"; - o->newline(1) << "if (! _stp_unprivileged_user)"; - o->newline(1) << "return 0;"; - - o->newline(-1) << "_stp_error (\"You are attempting to run stap as an ordinary user.\");"; - o->newline() << "_stp_error (\"Your module must be compiled using the --unprivileged option.\");"; - o->newline() << "return 1;"; - - o->newline(-1) << "}\n"; -} - - -void c_unparser::emit_module_init () { vector<derived_probe_group*> g = all_session_groups (*session); @@ -1156,11 +1131,6 @@ c_unparser::emit_module_init () o->newline(-1) << "}"; - if (! session->unprivileged) { - // Check whether the user is unprivileged. - o->newline() << "if (systemtap_unprivileged_user_check ()) rc = -EINVAL;"; - } - o->newline() << "if (rc) goto out;"; // initialize gettimeofday (if needed) @@ -5217,9 +5187,6 @@ translate_pass (systemtap_session& s) s.op->assert_0_indent(); s.op->newline(); - s.up->emit_unprivileged_user_check (); - s.op->assert_0_indent(); - s.op->newline(); s.up->emit_module_init (); s.op->assert_0_indent(); s.op->newline(); |