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 <smokewood@qq.com>
This commit is contained in:
Shell 2024-09-14 16:49:37 +08:00 committed by Meco Man
parent beb7bc42de
commit d45e13c471
1 changed files with 4 additions and 4 deletions

View File

@ -408,16 +408,16 @@ mode_t dfs_devfs_device_to_mode(struct rt_device *device)
switch (device->type) switch (device->type)
{ {
case RT_Device_Class_Char: case RT_Device_Class_Char:
mode = S_IFCHR | 0777; mode = S_IFCHR | 0666;
break; break;
case RT_Device_Class_Block: case RT_Device_Class_Block:
mode = S_IFBLK | 0777; mode = S_IFBLK | 0666;
break; break;
case RT_Device_Class_Pipe: case RT_Device_Class_Pipe:
mode = S_IFIFO | 0777; mode = S_IFIFO | 0666;
break; break;
default: default:
mode = S_IFCHR | 0777; mode = S_IFCHR | 0666;
break; break;
} }