diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2007-03-08 12:28:03 +0100 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2007-03-08 12:28:03 +0100 |
commit | 5b7363c0642c2c513b7ebd58bd0cbbcbea355fdf (patch) | |
tree | 73c89dff280e36c37e80b3eb97f108bebfa6fe34 /extras/floppy | |
parent | 684e935fafdf75c57f1cfd6b91666353270bce8d (diff) |
create_floppy_devices: apply specified mode without umask
Diffstat (limited to 'extras/floppy')
-rw-r--r-- | extras/floppy/create_floppy_devices.c | 5 |
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++; } |