Skip to content

Commit d45e13c

Browse files
polarvidmysterywolf
authored andcommitted
fixup: dfs_v2: Correct device mode permissions in devfs
The mode permissions for character, block, and pipe devices were previously set to 0777, which is overly permissive and not in line with standard practice. This change reduces the permissions to 0666, restricting execute permissions while still allowing read/write access. Changes: - Adjusted permissions for character/block/pipe devices from 0777 to 0666. Signed-off-by: Shell <[email protected]>
1 parent beb7bc4 commit d45e13c

File tree

1 file changed

+4
-4
lines changed
  • components/dfs/dfs_v2/filesystems/devfs

1 file changed

+4
-4
lines changed

components/dfs/dfs_v2/filesystems/devfs/devfs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,16 +408,16 @@ mode_t dfs_devfs_device_to_mode(struct rt_device *device)
408408
switch (device->type)
409409
{
410410
case RT_Device_Class_Char:
411-
mode = S_IFCHR | 0777;
411+
mode = S_IFCHR | 0666;
412412
break;
413413
case RT_Device_Class_Block:
414-
mode = S_IFBLK | 0777;
414+
mode = S_IFBLK | 0666;
415415
break;
416416
case RT_Device_Class_Pipe:
417-
mode = S_IFIFO | 0777;
417+
mode = S_IFIFO | 0666;
418418
break;
419419
default:
420-
mode = S_IFCHR | 0777;
420+
mode = S_IFCHR | 0666;
421421
break;
422422
}
423423

0 commit comments

Comments
 (0)