ash: add comment about bash's ENOEXEC handling. No code changes
authorDenys Vlasenko <vda.linux@googlemail.com>
Thu, 15 Dec 2011 23:25:17 +0000 (00:25 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 15 Dec 2011 23:25:17 +0000 (00:25 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
shell/ash.c

index 14472cb614042cd8779f34a961c8502a8d30d9f5..d02b74a4c2330301743d1cca620af695d6d6145b 100644 (file)
@@ -7435,6 +7435,12 @@ tryexec(IF_FEATURE_SH_STANDALONE(int applet_no,) char *cmd, char **argv, char **
                 *
                 * That is, do not use $SHELL, user's shell, or /bin/sh;
                 * just call ourselves.
+                *
+                * Note that bash reads ~80 chars of the file, and if it sees
+                * a zero byte before it sees newline, it doesn't try to
+                * interpret it, but fails with "cannot execute binary file"
+                * message. For one, it prevents atempts to interpret
+                * foreign ELF binaries as shell scripts.
                 */
                char **ap;
                char **new;