selinux: init once in the daemon, not in every event process

This commit is contained in:
Harald Hoyer 2006-08-18 03:47:59 +02:00 committed by Kay Sievers
parent 36dddd1ca4
commit eef7c9a385
4 changed files with 6 additions and 2 deletions

2
udev.c
View File

@ -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 */

View File

@ -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';

View File

@ -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) {

View File

@ -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");