mdev: set mode, needed when device node already exists.
authorDenis Vlasenko <vda.linux@googlemail.com>
Thu, 16 Apr 2009 22:42:01 +0000 (22:42 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Thu, 16 Apr 2009 22:42:01 +0000 (22:42 -0000)
testsuite/mdev.tests
util-linux/mdev.c

index 90379e6685b466cf8e5e92777a9d296fe741afba..388c41d529fc38634e4e8a65049612a0859082db 100755 (executable)
@@ -47,6 +47,18 @@ brw-rw-rw- 1 1 1 8,0 sda
 " \
        "" ""
 
+# continuing to use directory structure from prev test
+rm -rf mdev.testdir/dev/*
+echo "-.* 1:1 666" >mdev.testdir/etc/mdev.conf
+echo "sda 2:2 444" >>mdev.testdir/etc/mdev.conf
+testing "mdev does not stop on dash-rule" \
+       "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
+       ls -ln mdev.testdir/dev | $FILTER_LS" \
+"\
+br--r--r-- 1 2 2 8,0 sda
+" \
+       "" ""
+
 # continuing to use directory structure from prev test
 rm -rf mdev.testdir/dev/*
 echo "sda 0:0 444 >disk/scsiA" >mdev.testdir/etc/mdev.conf
index f965b606987081b083c3d4a896211fb4305d2652..43527f645b37f575a22a88cf22dc26f43b1f3f04 100644 (file)
@@ -274,6 +274,7 @@ static void make_device(char *path, int delete)
                        if (major == root_major && minor == root_minor)
                                symlink(device_name, "root");
 #if ENABLE_FEATURE_MDEV_CONF
+                       chmod(device_name, mode);
                        chown(device_name, ugid.uid, ugid.gid);
 # if ENABLE_FEATURE_MDEV_RENAME
                        if (alias) {