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

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

    fs/procfs: Report the search permission for directories.
    
    The procfs directories were reported as r--r--r--.  On a directory the
    execute bit is the search permission, so the directories looked as if
    nobody could look up a name in them.
    
    Report the procfs directories as r-xr-xr-x.  Files do not change.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 fs/procfs/fs_procfs.c         | 6 ++++--
 fs/procfs/fs_procfspressure.c | 3 ++-
 fs/procfs/fs_procfsproc.c     | 6 ++++--
 fs/procfs/fs_skeleton.c       | 3 ++-
 4 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/fs/procfs/fs_procfs.c b/fs/procfs/fs_procfs.c
index b680b1152d7..f1092f04c8a 100644
--- a/fs/procfs/fs_procfs.c
+++ b/fs/procfs/fs_procfs.c
@@ -1147,7 +1147,8 @@ static int procfs_stat(FAR struct inode *mountpt, FAR 
const char *relpath,
        * It's a read-only directory.
        */
 
-      buf->st_mode = S_IFDIR | S_IROTH | S_IRGRP | S_IRUSR;
+      buf->st_mode = S_IFDIR | S_IROTH | S_IRGRP | S_IRUSR |
+                     S_IXOTH | S_IXGRP | S_IXUSR;
       ret = OK;
     }
   else
@@ -1179,7 +1180,8 @@ static int procfs_stat(FAR struct inode *mountpt, FAR 
const char *relpath,
             {
               /* It's an internal subdirectory */
 
-              buf->st_mode = S_IFDIR | S_IROTH | S_IRGRP | S_IRUSR;
+              buf->st_mode = S_IFDIR | S_IROTH | S_IRGRP | S_IRUSR |
+                             S_IXOTH | S_IXGRP | S_IXUSR;
               ret = OK;
               break;
             }
diff --git a/fs/procfs/fs_procfspressure.c b/fs/procfs/fs_procfspressure.c
index 97f8767baaa..525c98915df 100644
--- a/fs/procfs/fs_procfspressure.c
+++ b/fs/procfs/fs_procfspressure.c
@@ -394,7 +394,8 @@ static int pressure_stat(const char *relpath, struct stat 
*buf)
 
   if (strcmp(relpath, "pressure") == 0 || strcmp(relpath, "pressure/") == 0)
     {
-      buf->st_mode = S_IFDIR | S_IROTH | S_IRGRP | S_IRUSR;
+      buf->st_mode = S_IFDIR | S_IROTH | S_IRGRP | S_IRUSR |
+                     S_IXOTH | S_IXGRP | S_IXUSR;
     }
   else if (strcmp(relpath, "pressure/memory") == 0)
     {
diff --git a/fs/procfs/fs_procfsproc.c b/fs/procfs/fs_procfsproc.c
index e5e83f1933c..15008cf74c8 100644
--- a/fs/procfs/fs_procfsproc.c
+++ b/fs/procfs/fs_procfsproc.c
@@ -2200,7 +2200,8 @@ static int proc_stat(const char *relpath, struct stat 
*buf)
     {
       /* Yes ... It's a read-only directory */
 
-      buf->st_mode = S_IFDIR | S_IROTH | S_IRGRP | S_IRUSR;
+      buf->st_mode = S_IFDIR | S_IROTH | S_IRGRP | S_IRUSR |
+                     S_IXOTH | S_IXGRP | S_IXUSR;
     }
 
   /* Verify that the process ID is followed by valid path segment delimiter */
@@ -2241,7 +2242,8 @@ static int proc_stat(const char *relpath, struct stat 
*buf)
         }
       else
         {
-          buf->st_mode = S_IFDIR | S_IROTH | S_IRGRP | S_IRUSR;
+          buf->st_mode = S_IFDIR | S_IROTH | S_IRGRP | S_IRUSR |
+                         S_IXOTH | S_IXGRP | S_IXUSR;
         }
     }
 
diff --git a/fs/procfs/fs_skeleton.c b/fs/procfs/fs_skeleton.c
index a760e13eea0..0eb9c22424e 100644
--- a/fs/procfs/fs_skeleton.c
+++ b/fs/procfs/fs_skeleton.c
@@ -484,7 +484,8 @@ static int skel_stat(FAR const char *relpath, FAR struct 
stat *buf)
    */
 
   memset(buf, 0, sizeof(struct stat));
-  buf->st_mode = S_IFDIR | S_IROTH | S_IRGRP | S_IRUSR;
+  buf->st_mode = S_IFDIR | S_IROTH | S_IRGRP | S_IRUSR |
+                 S_IXOTH | S_IXGRP | S_IXUSR;
 
   /* TODO:  Set S_IFREG if the relpath refers to a file.
    * TODO:  If the skel_write() method is supported, then stat must also

Reply via email to