chiark / gitweb /
[PATCH] udev - correct relative symlink
[elogind.git] / udev-add.c
index 0d3131300ff9d175373d79d897493b7c3d376381..8fdd66fad52511d0f1bc9c165608bb160fade14d 100644 (file)
@@ -38,6 +38,7 @@
 #include "udev.h"
 #include "udev_version.h"
 #include "udev_dbus.h"
+#include "udev_selinux.h"
 #include "logging.h"
 #include "namedev.h"
 #include "udevdb.h"
@@ -217,6 +218,9 @@ static int create_node(struct udevice *dev, int fake)
                }
        }
 
+       if (!fake)
+               selinux_add_node(filename);
+
        /* create symlink if requested */
        if (dev->symlink[0] != '\0') {
                symlinks = dev->symlink;
@@ -247,8 +251,6 @@ static int create_node(struct udevice *dev, int fake)
                                i++;
                        }
 
-                       if (linktarget[0] == '\0')
-                               strfieldcpy(linktarget, "./");
                        strfieldcat(linktarget, &dev->name[tail]);
 
                        /* unlink existing files to ensure that our symlink is created */