Procházet zdrojové kódy

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 před 9 měsíci
rodič
revize
d45e13c471
1 změnil soubory, kde provedl 4 přidání a 4 odebrání
  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;
     }