diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/staprun/modverify.c | 5 | ||||
-rw-r--r-- | runtime/staprun/staprun.c | 9 |
2 files changed, 12 insertions, 2 deletions
diff --git a/runtime/staprun/modverify.c b/runtime/staprun/modverify.c index 15447279..6dc192b2 100644 --- a/runtime/staprun/modverify.c +++ b/runtime/staprun/modverify.c @@ -33,6 +33,7 @@ #include "modverify.h" #include <sys/stat.h> +#include <errno.h> /* Function: int check_cert_db_permissions (const char *cert_db_path); * @@ -125,6 +126,10 @@ check_cert_db_permissions (const char *cert_db_path) { rc = stat (cert_db_path, & info); if (rc) { + /* It is ok if the directory does not exist. This simply means that no signing + certificates have been authorized yet. */ + if (errno == ENOENT) + return 0; fprintf (stderr, "Could not obtain information on certificate database directory %s.\n", cert_db_path); perror (""); diff --git a/runtime/staprun/staprun.c b/runtime/staprun/staprun.c index c64bf5b3..7eb7f28f 100644 --- a/runtime/staprun/staprun.c +++ b/runtime/staprun/staprun.c @@ -132,9 +132,14 @@ static int enable_uprobes(void) snprintf (runtimeko, sizeof(runtimeko), "%s/uprobes/uprobes.ko", (getenv("SYSTEMTAP_RUNTIME") ?: PKGDATADIR "/runtime")); dbug(2, "Inserting uprobes module from SystemTap runtime %s.\n", runtimeko); - argv[0] = NULL; + i = 0; + argv[i++] = "/sbin/insmod"; + argv[i++] = runtimeko; + argv[i] = NULL; + if (run_as(0, 0, 0, argv[0], argv) == 0) + return 0; - return insert_module(runtimeko, NULL, argv); + return 1; /* failure */ } static int insert_stap_module(void) |