summaryrefslogtreecommitdiff
path: root/extras/floppy
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2007-03-08 12:28:03 +0100
committerKay Sievers <kay.sievers@vrfy.org>2007-03-08 12:28:03 +0100
commit5b7363c0642c2c513b7ebd58bd0cbbcbea355fdf (patch)
tree73c89dff280e36c37e80b3eb97f108bebfa6fe34 /extras/floppy
parent684e935fafdf75c57f1cfd6b91666353270bce8d (diff)
create_floppy_devices: apply specified mode without umask
Diffstat (limited to 'extras/floppy')
-rw-r--r--extras/floppy/create_floppy_devices.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/extras/floppy/create_floppy_devices.c b/extras/floppy/create_floppy_devices.c
index 7b61ef05b1..7a3ddb2ffe 100644
--- a/extras/floppy/create_floppy_devices.c
+++ b/extras/floppy/create_floppy_devices.c
@@ -74,7 +74,7 @@ int main(int argc, char **argv)
int major = 2, minor;
uid_t uid = 0;
gid_t gid = 0;
- mode_t mode = 0;
+ mode_t mode = 0660;
int create_nodes = 0;
int print_nodes = 0;
int unlink_nodes = 0;
@@ -165,10 +165,11 @@ int main(int argc, char **argv)
printf("%s b %d %d %d\n", node, mode, major, minor);
if (create_nodes) {
unlink(node);
- selinux_setfscreatecon(node, NULL, mode);
+ selinux_setfscreatecon(node, NULL, S_IFBLK | mode);
mknod(node, S_IFBLK | mode, makedev(major,minor));
selinux_resetfscreatecon();
chown(node, uid, gid);
+ chmod(node, S_IFBLK | mode);
}
i++;
}