This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] posix: Fix posix_spawnpi to not execute invalid binaries in non compat mode (BZ#23264)


On 06/06/2018 08:11 PM, Adhemerval Zanella wrote:

+/* Same as __EXECVPE, but does not try to issue ENOEXEC files.  */
+int
+__execvpex (const char *file, char *const argv[], char *const envp[])

“does not try to execute NOEXEC files”

+#define EXPECTED_EXIT_CODE 65
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)

Is the STR macro really worth it?

+  const char script[] = "exit " STR(EXPECTED_EXIT_CODE);
+  write (fd, script, sizeof (script) - 1);

xwrite?

+  const char script[] = "echo it should not happen";
+  write (fd, script, sizeof (script) - 1);

Likewise xwrite.

Patch looks okay to me otherwise.

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]