From 7ca6c44494127911bb15f8a4203153a8bffe1996 Mon Sep 17 00:00:00 2001 From: Shell Date: Sat, 14 Sep 2024 16:49:37 +0800 Subject: [PATCH] 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 --- components/dfs/dfs_v2/filesystems/devfs/devfs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/dfs/dfs_v2/filesystems/devfs/devfs.c b/components/dfs/dfs_v2/filesystems/devfs/devfs.c index c8c66667dbc..22d24bd684b 100644 --- a/components/dfs/dfs_v2/filesystems/devfs/devfs.c +++ b/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; }