summaryrefslogtreecommitdiffstats
path: root/runtime/staprun/staprun.c
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2009-11-09 14:50:52 -0500
committerDave Brolley <brolley@redhat.com>2009-11-09 14:50:52 -0500
commit64211010978d0e35c80ec7c119f1986a48f97543 (patch)
tree4a9d67ed8f7682cf8eb61686709fd69341394e63 /runtime/staprun/staprun.c
parent5e90af3e298ae39838acedf85f1301806143e920 (diff)
downloadsystemtap-steved-64211010978d0e35c80ec7c119f1986a48f97543.tar.gz
systemtap-steved-64211010978d0e35c80ec7c119f1986a48f97543.tar.xz
systemtap-steved-64211010978d0e35c80ec7c119f1986a48f97543.zip
Don't reference global variable modpath in insert_module and its helpers.
This allows insert_module to to be used for loading the signed uprobes.ko module. Allow the use of $$parms and $$return in uprobes based probes for unprivileged users. Re-add management of module signatures in the cache. Don't know why it was removed.
Diffstat (limited to 'runtime/staprun/staprun.c')
-rw-r--r--runtime/staprun/staprun.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/runtime/staprun/staprun.c b/runtime/staprun/staprun.c
index c5651d9a..078be4cf 100644
--- a/runtime/staprun/staprun.c
+++ b/runtime/staprun/staprun.c
@@ -129,14 +129,12 @@ static int enable_uprobes(void)
if (run_as(0, 0, 0, argv[0], argv) == 0)
return 0;
+ /* This module may be signed, so use insert_module to load it. */
snprintf (runtimeko, sizeof(runtimeko), "%s/uprobes/uprobes.ko",
(getenv("SYSTEMTAP_RUNTIME") ?: PKGDATADIR "/runtime"));
dbug(2, "Inserting uprobes module from SystemTap runtime %s.\n", runtimeko);
- i = 0;
- argv[i++] = "/sbin/insmod";
- argv[i++] = runtimeko;
- argv[i] = NULL;
- if (run_as(0, 0, 0, argv[0], argv) == 0)
+ argv[0] = NULL;
+ if (insert_module(runtimeko, NULL, argv, assert_uprobes_module_permissions) == 0)
return 0;
return 1; /* failure */
@@ -150,7 +148,7 @@ static int insert_stap_module(void)
if (snprintf_chk(special_options, sizeof (special_options), "_stp_bufsize=%d", buffer_size))
return -1;
- return insert_module(modpath, special_options, modoptions);
+ return insert_module(modpath, special_options, modoptions, assert_stap_module_permissions);
}
static int remove_module(const char *name, int verb);