chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
manager: cast mkdir() result to (void) to make sure coverity is quiet
[elogind.git]
/
src
/
core
/
kmod-setup.c
diff --git
a/src/core/kmod-setup.c
b/src/core/kmod-setup.c
index 0791ae8eadb6e1065b2fb4f85c2fd213299d2845..38e1726e08a83e2feea3509f74d67faae80ebc71 100644
(file)
--- a/
src/core/kmod-setup.c
+++ b/
src/core/kmod-setup.c
@@
-27,7
+27,7
@@
#include "macro.h"
#include "execute.h"
#include "macro.h"
#include "execute.h"
-
+#include "capability.h"
#include "kmod-setup.h"
static void systemd_kmod_log(
#include "kmod-setup.h"
static void systemd_kmod_log(
@@
-47,13
+47,14
@@
static void systemd_kmod_log(
static bool cmdline_check_kdbus(void) {
_cleanup_free_ char *line = NULL;
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) {
return false;
return strstr(line, "kdbus") != NULL;
}
int kmod_setup(void) {
+
static const struct {
const char *module;
const char *path;
static const struct {
const char *module;
const char *path;
@@
-76,6
+77,9
@@
int kmod_setup(void) {
unsigned int i;
int r;
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;
for (i = 0; i < ELEMENTSOF(kmod_table); i++) {
struct kmod_module *mod;