fs/vfs: fix pseudoFS mode reporting

Preserve only the existing file type bits (S_IFMT) and
replace permission bits from inode->i_mode instead of
merging them with |= semantics.

This fixes pseudoFS stat()/ls mode reporting after
chmod() updates.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
This commit is contained in:
Abhishek Mishra
2026-05-13 22:37:12 +00:00
committed by Matteo Golin
parent e05292f9da
commit 08dded1f22
+1 -1
View File
@@ -454,7 +454,7 @@ int inode_stat(FAR struct inode *inode, FAR struct stat *buf, int resolve)
}
#ifdef CONFIG_PSEUDOFS_ATTRIBUTES
buf->st_mode |= inode->i_mode;
buf->st_mode = (buf->st_mode & S_IFMT) | inode->i_mode;
buf->st_uid = inode->i_owner;
buf->st_gid = inode->i_group;
buf->st_atim = inode->i_atime;