From: kay.sievers@vrfy.org Date: Thu, 10 Feb 2005 18:46:50 +0000 (+0100) Subject: [PATCH] fix special file mode mask for temporary device node X-Git-Tag: 053~8 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a24dc747788b6049ef35607ff252e3965af2ce5;p=systemd [PATCH] fix special file mode mask for temporary device node --- diff --git a/test/udev-test.pl b/test/udev-test.pl index 992fc001..1b1ee909 100644 --- a/test/udev-test.pl +++ b/test/udev-test.pl @@ -1068,7 +1068,7 @@ EOF devpath => "/block/sda", exp_name => "sda", conf => <type) { + case 'b': + mode |= S_IFBLK; + break; + case 'c': + case 'u': + mode |= S_IFCHR; + break; + case 'p': + mode |= S_IFIFO; + break; + default: + dbg("unknown node type %c\n", udev->type); + return -EINVAL; + } + selinux_setfscreatecon(file, udev->kernel_name, mode); retval = mknod(file, mode, makedev(major, minor)); if (retval != 0) { @@ -131,24 +147,8 @@ static int create_node(struct udevice *udev, struct sysfs_class_device *class_de snprintf(filename, NAME_SIZE, "%s/%s", udev_root, udev->name); filename[NAME_SIZE-1] = '\0'; - switch (udev->type) { - case 'b': - udev->mode |= S_IFBLK; - break; - case 'c': - case 'u': - udev->mode |= S_IFCHR; - break; - case 'p': - udev->mode |= S_IFIFO; - break; - default: - dbg("unknown node type %c\n", udev->type); - return -EINVAL; - } - /* create parent directories if needed */ - if (strrchr(udev->name, '/')) + if (strchr(udev->name, '/')) create_path(filename); if (udev->owner[0] != '\0') {