mirror of
https://github.com/AuxXxilium/eudev.git
synced 2024-12-28 06:35:34 +07:00
selinux: init once in the daemon, not in every event process
This commit is contained in:
parent
36dddd1ca4
commit
eef7c9a385
2
udev.c
2
udev.c
@ -32,6 +32,7 @@
|
||||
|
||||
#include "udev.h"
|
||||
#include "udev_rules.h"
|
||||
#include "udev_selinux.h"
|
||||
|
||||
#ifdef USE_LOG
|
||||
void log_message(int priority, const char *format, ...)
|
||||
@ -93,6 +94,7 @@ int main(int argc, char *argv[], char *envp[])
|
||||
if (devnull < 0)
|
||||
err("fatal, could not open /dev/null: %s", strerror(errno));
|
||||
udev_config_init();
|
||||
selinux_init();
|
||||
dbg("version %s", UDEV_VERSION);
|
||||
|
||||
/* set signal handlers */
|
||||
|
@ -130,8 +130,6 @@ int udev_node_add(struct udevice *udev, struct udevice *udev_old)
|
||||
int i;
|
||||
int retval = 0;
|
||||
|
||||
selinux_init();
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/%s", udev_root, udev->name);
|
||||
filename[sizeof(filename)-1] = '\0';
|
||||
|
||||
|
2
udevd.c
2
udevd.c
@ -45,6 +45,7 @@
|
||||
#include "udev.h"
|
||||
#include "udev_rules.h"
|
||||
#include "udevd.h"
|
||||
#include "udev_selinux.h"
|
||||
|
||||
static struct udev_rules rules;
|
||||
static int udevd_sock = -1;
|
||||
@ -931,6 +932,7 @@ int main(int argc, char *argv[], char *envp[])
|
||||
err("fatal, could not open /dev/null: %s", strerror(errno));
|
||||
|
||||
udev_config_init();
|
||||
selinux_init();
|
||||
dbg("version %s", UDEV_VERSION);
|
||||
|
||||
if (getuid() != 0) {
|
||||
|
@ -40,6 +40,7 @@
|
||||
|
||||
#include "udev.h"
|
||||
#include "udev_rules.h"
|
||||
#include "udev_selinux.h"
|
||||
|
||||
static const char *udev_run_str;
|
||||
static const char *udev_log_str;
|
||||
@ -339,6 +340,7 @@ int main(int argc, char *argv[], char *envp[])
|
||||
|
||||
logging_init("udevstart");
|
||||
udev_config_init();
|
||||
selinux_init();
|
||||
dbg("version %s", UDEV_VERSION);
|
||||
|
||||
udev_run_str = getenv("UDEV_RUN");
|
||||
|
Loading…
Reference in New Issue
Block a user