#include "macro.h"
#include "execute.h"
-
+#include "capability.h"
#include "kmod-setup.h"
static void systemd_kmod_log(
static bool cmdline_check_kdbus(void) {
_cleanup_free_ char *line = NULL;
- if (proc_cmdline(&line) <= 0)
+ if (proc_cmdline(&line) < 0)
return false;
return strstr(line, "kdbus") != NULL;
}
int kmod_setup(void) {
+
static const struct {
const char *module;
const char *path;
unsigned int i;
int r;
+ if (have_effective_cap(CAP_SYS_MODULE) == 0)
+ return 0;
+
for (i = 0; i < ELEMENTSOF(kmod_table); i++) {
struct kmod_module *mod;