xiaoxiang781216 commented on code in PR #20764:
URL: https://github.com/apache/nuttx/pull/20764#discussion_r4308463299


##########
binfmt/script.c:
##########
@@ -177,6 +181,22 @@ static int script_loadbinary(FAR struct binary_s *binp,
       return ret;
     }
 
+#ifdef CONFIG_BINFMT_CHECKEXEC
+  /* The script needs execute permission, as its interpreter does */
+
+  ret = file_fstat(&file, &st);
+  if (ret >= 0)
+    {
+      ret = binfmt_checkexecperm(st.st_mode, st.st_uid, st.st_gid);
+    }
+
+  if (ret < 0)
+    {
+      file_close(&file);
+      return ret;
+    }
+#endif
+

Review Comment:
   should we update binp->uid too?



-- 
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