Date: Sat, 5 Feb 2011 12:54:59 +0000 (UTC) From: Jilles Tjoelker <jilles@FreeBSD.org> To: cvs-src-old@freebsd.org Subject: cvs commit: src/bin/sh exec.c sh.1 src/tools/regression/bin/sh/errors bad-binary1.126 Message-ID: <201102051257.p15CvodF096362@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
jilles 2011-02-05 12:54:59 UTC FreeBSD src repository Modified files: bin/sh exec.c sh.1 Added files: tools/regression/bin/sh/errors bad-binary1.126 Log: SVN rev 218320 on 2011-02-05 12:54:59Z by jilles sh: Do not try to execute binary files as scripts. If execve() returns an [ENOEXEC] error, check if the file is binary before trying to execute it using sh. A file is considered binary if at least one of the first 256 bytes is '\0'. In particular, trying to execute ELF binaries for the wrong architecture now fails with an "Exec format error" message instead of syntax errors and potentially strange results. Revision Changes Path 1.50 +15 -1 src/bin/sh/exec.c 1.157 +1 -0 src/bin/sh/sh.1 1.1 +12 -0 src/tools/regression/bin/sh/errors/bad-binary1.126 (new)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102051257.p15CvodF096362>