linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: [PATCH] udev_selinux changes
Date: Tue, 13 Apr 2004 01:50:46 +0000	[thread overview]
Message-ID: <20040413015046.GA4112@vrfy.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 198 bytes --]

Here is the fix for extras/seliux/*
 o install the binary in /sbin/
 o add symlink to /etc/dev.d/ with suffix .dev
 o removed the undefined udev_log variable
 o fixed compiler warnings

thanks,
Kay

[-- Attachment #2: 01-selinux.patch --]
[-- Type: text/plain, Size: 3629 bytes --]

===== extras/dbus/Makefile 1.3 vs edited =====
--- 1.3/extras/dbus/Makefile	Sun Apr 11 14:38:01 2004
+++ edited/extras/dbus/Makefile	Tue Apr 13 03:21:55 2004
@@ -53,16 +53,16 @@
 
 install-dbus-policy:
 	$(INSTALL) -d $(DESTDIR)$(dbusdir)
-	$(INSTALL_DATA) etc/dbus-1/system.d/udev_sysbus_policy.conf $(DESTDIR)$(dbusdir)
-	$(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(usrsbindir)/$(PROG)
-	- ln -s -f $(DESTDIR)$(usrsbindir)/$(PROG) $(DESTDIR)$(devddir)/$(PROG).dev
 
 uninstall-dbus-policy:
 	- rm $(DESTDIR)$(dbusdir)/udev_sysbus_policy.conf
-	- rm $(DESTDIR)$(devddir)/$(PROG).dev
-	- rm $(DESTDIR)$(usrsbindir)/$(PROG)
 
 install: install-dbus-policy all
+	$(INSTALL_DATA) etc/dbus-1/system.d/udev_sysbus_policy.conf $(DESTDIR)$(dbusdir)
+	$(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(usrsbindir)/$(PROG)
+	- ln -s -f $(DESTDIR)$(usrsbindir)/$(PROG) $(DESTDIR)$(devddir)/$(PROG).dev
 
 uninstall: uninstall-dbus-policy
+	- rm $(DESTDIR)$(devddir)/$(PROG).dev
+	- rm $(DESTDIR)$(usrsbindir)/$(PROG)
 
===== extras/selinux/Makefile 1.2 vs edited =====
--- 1.2/extras/selinux/Makefile	Wed Mar 24 23:41:45 2004
+++ edited/extras/selinux/Makefile	Tue Apr 13 03:38:54 2004
@@ -26,7 +26,9 @@
 etcdir =	${prefix}/etc
 sbindir =	${exec_prefix}/sbin
 usrbindir =	${exec_prefix}/usr/bin
+usrsbindir =	${exec_prefix}/usr/sbin
 mandir =	${prefix}/usr/share/man
+devddir =	${etcdir}/dev.d/default
 hotplugdir =	${etcdir}/hotplug.d/default
 configdir =	${etcdir}/udev/
 initdir = 	${etcdir}/init.d/
@@ -52,8 +54,11 @@
 
 spotless: clean
 
-
 install: all
+	$(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG)
+	- ln -s -f $(DESTDIR)$(sbindir)/$(PROG) $(DESTDIR)$(devddir)/$(PROG).dev
 
-uninstall: 
+uninstall:
+	- rm $(DESTDIR)$(devddir)/$(PROG).dev
+	- rm $(DESTDIR)$(sbindir)/$(PROG)
 
===== extras/selinux/udev_selinux.c 1.5 vs edited =====
--- 1.5/extras/selinux/udev_selinux.c	Mon Apr  5 22:20:27 2004
+++ edited/extras/selinux/udev_selinux.c	Tue Apr 13 03:35:15 2004
@@ -1,10 +1,27 @@
+/*
+ * udev_selinux.c
+ *
+ * Copyright (C) 2004 Daniel J Walsh <dwalsh@redhat.com>
+ *
+ *	This program is free software; you can redistribute it and/or modify it
+ *	under the terms of the GNU General Public License as published by the
+ *	Free Software Foundation version 2 of the License.
+ * 
+ *	This program is distributed in the hope that it will be useful, but
+ *	WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *	General Public License for more details.
+ * 
+ *	You should have received a copy of the GNU General Public License along
+ *	with this program; if not, write to the Free Software Foundation, Inc.,
+ *	675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
-#include <fcntl.h>
-#include <unistd.h>
 #include <errno.h>
-#include <ctype.h>
 #include <selinux/selinux.h>
 
 #include "../../udev_lib.h"
@@ -16,16 +33,13 @@
 {
 	va_list args;
 
-	if (!udev_log)
-		return;
-
 	va_start(args, format);
 	vsyslog(level, format, args);
 	va_end(args);
 }
 #endif
 
-void selinux_add_node(char *filename)
+static void selinux_add_node(char *filename)
 {
 	int retval;
 
@@ -35,7 +49,7 @@
 		if (retval < 0) {
 			dbg("matchpathcon(%s) failed\n", filename);
 		} else {
-			retval=setfilecon(filename,scontext);
+			retval = setfilecon(filename,scontext);
 			if (retval < 0)
 				dbg("setfiles %s failed with error '%s'",
 				    filename, strerror(errno));
@@ -47,7 +61,6 @@
 int main(int argc, char *argv[], char *envp[])
 {
 	char *action;
-	char *devpath;
 	char *devname;
 	int retval = 0;
 

             reply	other threads:[~2004-04-13  1:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-13  1:50 Kay Sievers [this message]
2004-04-16 23:05 ` [PATCH] udev_selinux changes Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040413015046.GA4112@vrfy.org \
    --to=kay.sievers@vrfy.org \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).