diff options
author | Dave Brolley <brolley@redhat.com> | 2009-11-05 14:52:56 -0500 |
---|---|---|
committer | Dave Brolley <brolley@redhat.com> | 2009-11-05 14:52:56 -0500 |
commit | a0fc7f8e96d3818a963ad41aa5043d2a5bbcb9e5 (patch) | |
tree | 37ef7bd65bf563fb88d0cb5ef34227fed324ef31 /runtime | |
parent | 5807ac6473b47074cd90f93f5b1b3c3eb452fed9 (diff) | |
download | systemtap-steved-a0fc7f8e96d3818a963ad41aa5043d2a5bbcb9e5.tar.gz systemtap-steved-a0fc7f8e96d3818a963ad41aa5043d2a5bbcb9e5.tar.xz systemtap-steved-a0fc7f8e96d3818a963ad41aa5043d2a5bbcb9e5.zip |
PR 9973: Sign uprobes.ko when it is created and load it using insert_module.
Create home directory manually for stap-server.
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/staprun/staprun.c | 8 | ||||
-rw-r--r-- | runtime/uprobes/Makefile | 9 |
2 files changed, 11 insertions, 6 deletions
diff --git a/runtime/staprun/staprun.c b/runtime/staprun/staprun.c index c5651d9a..1cedc9f0 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) == 0) return 0; return 1; /* failure */ diff --git a/runtime/uprobes/Makefile b/runtime/uprobes/Makefile index a9630e5a..4ab637e2 100644 --- a/runtime/uprobes/Makefile +++ b/runtime/uprobes/Makefile @@ -7,12 +7,19 @@ DEPENDENCIES += Makefile default: $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules + if test -f ../../../../bin/stap-sign-module; then \ + for f in *.ko; do \ + if test ! -e $$f.sgn -o $$f.sgn -ot $$f; then \ + ../../../../bin/stap-sign-module $$f ../../../../etc/systemtap/ssl/server; \ + fi \ + done \ + fi # This target is used with "make -q" to see whether a "real" build is needed. uprobes.ko: $(DEPENDENCIES) @echo uprobes.ko is not a valid target. See Makefile. clean: - rm -f *.mod.c *.ko *.o .*.cmd *~ + rm -f *.mod.c *.ko *.o .*.cmd *~ *.sgn rm -f Module.markers modules.order Module.symvers rm -rf .tmp_versions |