casaroli commented on code in PR #20771:
URL: https://github.com/apache/nuttx/pull/20771#discussion_r4307851074


##########
libs/libc/unistd/lib_access.c:
##########
@@ -92,16 +153,19 @@ int access(FAR const char *path, int amode)
       return 0;
     }
 
-  if (amode & W_OK)
+  if ((amode & W_OK) != 0 && (s.st_mode & S_IWUSR) == 0)
     {
-      if (s.st_mode & S_IWUSR)
-        {
-          return 0;
-        }
+      set_errno(EACCES);
+      return -1;
+    }
 
+#ifdef CONFIG_BINFMT_CHECKEXEC

Review Comment:
   Done: it is not needed. X_OK is now checked in every build. File systems 
that store no mode report execute bits, so it does not fail there. This PR no 
longer depends on #20764.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to