This is an automated email from the ASF dual-hosted git repository.

linguini1 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 08dded1f227 fs/vfs: fix pseudoFS mode reporting
08dded1f227 is described below

commit 08dded1f227e2823c06f5121e48ca122aed65831
Author: Abhishek Mishra <[email protected]>
AuthorDate: Wed May 13 22:37:12 2026 +0000

    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 <[email protected]>
---
 fs/vfs/fs_stat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/vfs/fs_stat.c b/fs/vfs/fs_stat.c
index 22209d6e8c6..7e4a29ac79c 100644
--- a/fs/vfs/fs_stat.c
+++ b/fs/vfs/fs_stat.c
@@ -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;

Reply via email to