mirror of
https://github.com/apache/nuttx.git
synced 2026-05-24 16:11:56 +08:00
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:
committed by
Matteo Golin
parent
e05292f9da
commit
08dded1f22
+1
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user