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

acassis 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 b126308af20 fs/smartfs: Report the search permission for directories.
b126308af20 is described below

commit b126308af20b13d32c4da7f1725a44445cf1c299
Author: Marco Casaroli <[email protected]>
AuthorDate: Sat Oct 17 23:57:58 2026 +0200

    fs/smartfs: Report the search permission for directories.
    
    The root directory of smartfs was reported as rw-rw-rw-, and the
    directories of the smartfs procfs entries as r--r--r--.  On a directory
    the execute bit is the search permission.
    
    Report the search bit for these directories.  The other directories
    keep the mode they were created with.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 fs/smartfs/smartfs_procfs.c | 4 ++--
 fs/smartfs/smartfs_smart.c  | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/fs/smartfs/smartfs_procfs.c b/fs/smartfs/smartfs_procfs.c
index 024c86195e5..654c5f47274 100644
--- a/fs/smartfs/smartfs_procfs.c
+++ b/fs/smartfs/smartfs_procfs.c
@@ -714,7 +714,7 @@ static int smartfs_stat(const char *relpath, struct stat 
*buf)
     {
       if (level1.base.level < 3)
         {
-          buf->st_mode |= S_IFDIR;
+          buf->st_mode |= S_IFDIR | S_IXOTH | S_IXGRP | S_IXUSR;
         }
       else
         {
@@ -722,7 +722,7 @@ static int smartfs_stat(const char *relpath, struct stat 
*buf)
 
           if (g_direntry[level1.direntry].type == DTYPE_DIRECTORY)
             {
-              buf->st_mode |= S_IFDIR;
+              buf->st_mode |= S_IFDIR | S_IXOTH | S_IXGRP | S_IXUSR;
             }
           else
             {
diff --git a/fs/smartfs/smartfs_smart.c b/fs/smartfs/smartfs_smart.c
index 2a4cf132922..7b75bf1ccac 100644
--- a/fs/smartfs/smartfs_smart.c
+++ b/fs/smartfs/smartfs_smart.c
@@ -2128,8 +2128,7 @@ static void smartfs_stat_common(FAR struct 
smartfs_mountpt_s *fs,
     {
       /* It's directory name of the mount point */
 
-      buf->st_mode = S_IFDIR | S_IROTH | S_IRGRP | S_IRUSR | S_IWOTH |
-                     S_IWGRP | S_IWUSR;
+      buf->st_mode = S_IFDIR | S_IRWXO | S_IRWXG | S_IRWXU;
     }
   else
     {

Reply via email to