chiark / gitweb /
let $attr{symlink} return the last element of the path
[elogind.git] / udev_node.c
index ee59d4ae7c74b0642a37d391a97d58005f26b285..e1b62293bb08b932f3218834f1a542f0f3c3ab19 100644 (file)
@@ -1,8 +1,6 @@
 /*
- * udev-node.c - device node handling
- *
  * Copyright (C) 2003 Greg Kroah-Hartman <greg@kroah.com>
- * Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
+ * Copyright (C) 2004-2006 Kay Sievers <kay.sievers@vrfy.org>
  *
  *     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
@@ -15,7 +13,7 @@
  * 
  *     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.
+ *     51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
  */
 
@@ -51,7 +49,7 @@ int udev_node_mknod(struct udevice *udev, const char *file, dev_t devt, mode_t m
        /* preserve node with already correct numbers, to prevent changing the inode number */
        if ((stats.st_mode & S_IFMT) == (mode & S_IFMT) && (stats.st_rdev == devt)) {
                info("preserve file '%s', because it has correct dev_t", file);
-               selinux_setfilecon(file, udev->dev->kernel_name, stats.st_mode);
+               selinux_setfilecon(file, udev->dev->kernel, stats.st_mode);
                goto perms;
        }
 
@@ -61,7 +59,7 @@ int udev_node_mknod(struct udevice *udev, const char *file, dev_t devt, mode_t m
                dbg("already present file '%s' unlinked", file);
 
 create:
-       selinux_setfscreatecon(file, udev->dev->kernel_name, mode);
+       selinux_setfscreatecon(file, udev->dev->kernel, mode);
        retval = mknod(file, mode, devt);
        selinux_resetfscreatecon();
        if (retval != 0) {
@@ -130,8 +128,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';