summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2006-08-18 03:47:59 +0200
committerKay Sievers <kay.sievers@suse.de>2006-08-18 03:47:59 +0200
commiteef7c9a385575375a3e3310900022b37777aeb6c (patch)
treede14e8bd1130e7b539d516b8010168ff3b11df4f
parent36dddd1ca40b4abbe3352b4cb93b465f4038666e (diff)
selinux: init once in the daemon, not in every event process
-rw-r--r--udev.c2
-rw-r--r--udev_node.c2
-rw-r--r--udevd.c2
-rw-r--r--udevstart.c2
4 files changed, 6 insertions, 2 deletions
diff --git a/udev.c b/udev.c
index 17ab635f1e..c633fff14b 100644
--- a/udev.c
+++ b/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 */
diff --git a/udev_node.c b/udev_node.c
index ee59d4ae7c..12a738e4e2 100644
--- a/udev_node.c
+++ b/udev_node.c
@@ -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';
diff --git a/udevd.c b/udevd.c
index 5c51beed1e..bec4e3d7b4 100644
--- a/udevd.c
+++ b/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) {
diff --git a/udevstart.c b/udevstart.c
index 0d9b4f4004..d0a1ded2be 100644
--- a/udevstart.c
+++ b/udevstart.c
@@ -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");