Skip to contentSkip to conversation

selinux

PATCH Harald Hoyer 1 participant 1 message Apr 6, 2004

lore
Share & tools
lore
#0 lore raw

In extras there is udev_selinux. From where is this supposed to be called?

Attached is a totally untested patch to make it compile.

extras/selinux/Makefile renamed from extras/selinux/Makefile.sel +1 -0
@@ -54,6 +54,7 @@
 
 
 install: all
+	$(INSTALL_PROGRAM) -D $(PROG) $(DESTDIR)$(sbindir)/$(PROG)
 
 uninstall: 
 
extras/selinux/udev_selinux.c renamed from extras/selinux/udev_selinux.c.sel +21 -6
@@ -12,17 +12,32 @@
 
 #ifdef LOG
 unsigned char logname[LOGNAME_SIZE];
-void log_message(int level, const char *format, ...)
+static int debug;
+void log_message (int level, const char *format, ...)
 {
-	va_list args;
+	va_list	args;
 
-	if (!udev_log)
+	if (!debug && level == LOG_DEBUG)
 		return;
 
-	va_start(args, format);
-	vsyslog(level, format, args);
-	va_end(args);
+	va_start (args, format);
+	{
+		static int logging_init = 0;
+		if (!logging_init) {
+			/*
+			 * klibc does not have LOG_PID.
+			 */
+			snprintf(logname, 32, "udev_selinux[%d]", getpid());
+			openlog (logname, 0, LOG_DAEMON);
+			logging_init = 1;
+		}
+
+		vsyslog(level, format, args);
+	}
+	va_end (args);
+	return;
 }
+
 #endif
 
 void selinux_add_node(char *filename)