chiark / gitweb /
add O_NOFOLLOW when creating files in link stack
authorKay Sievers <kay.sievers@vrfy.org>
Mon, 19 Apr 2010 16:55:10 +0000 (18:55 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Mon, 19 Apr 2010 16:55:10 +0000 (18:55 +0200)
udev/udev-node.c

index 34de268..2a2c2cf 100644 (file)
@@ -323,7 +323,7 @@ static void link_update(struct udev_device *dev, const char *slink, bool add)
                        err = util_create_path(udev, filename);
                        if (err != 0 && err != -ENOENT)
                                break;
-                       fd = open(filename, O_WRONLY|O_CREAT, 0444);
+                       fd = open(filename, O_WRONLY|O_CREAT|O_NOFOLLOW, 0444);
                        if (fd >= 0)
                                close(fd);
                        else