diff options
Diffstat (limited to 'extras/selinux/udev_selinux.c')
-rw-r--r-- | extras/selinux/udev_selinux.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/extras/selinux/udev_selinux.c b/extras/selinux/udev_selinux.c index df23d9e6a7..8b1c2c7da8 100644 --- a/extras/selinux/udev_selinux.c +++ b/extras/selinux/udev_selinux.c @@ -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 @@ void log_message(int level, const char *format, ...) { 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 @@ void selinux_add_node(char *filename) 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 @@ void selinux_add_node(char *filename) int main(int argc, char *argv[], char *envp[]) { char *action; - char *devpath; char *devname; int retval = 0; |