xiaoxiang781216 commented on code in PR #20764:
URL: https://github.com/apache/nuttx/pull/20764#discussion_r4306055026
##########
binfmt/binfmt_loadmodule.c:
##########
@@ -103,10 +105,37 @@ static int load_absmodule(FAR struct binary_s *bin, FAR
const char *filename,
FAR const struct symtab_s *exports, int nexports)
{
FAR struct binfmt_s *binfmt;
+#ifdef CONFIG_BINFMT_CHECKEXEC
+ struct stat st;
+#endif
int ret = -ENOENT;
binfo("Loading %s\n", filename);
+#ifdef CONFIG_BINFMT_CHECKEXEC
+ /* Check the execute permission once, for every binary format. A name
+ * that is not a file (a builtin application without binfs) is checked
+ * by its loader.
+ */
+
+ if (nx_stat(filename, &st, 1) >= 0)
Review Comment:
but the old implementation could avoid calling nx_stat
--
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]