浏览代码

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>
Shell 7 月之前
父节点
当前提交
d45e13c471
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      components/dfs/dfs_v2/filesystems/devfs/devfs.c

+ 4 - 4
components/dfs/dfs_v2/filesystems/devfs/devfs.c

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