From owner-cvs-src-old@FreeBSD.ORG Sat Feb 5 12:57:50 2011 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB0BC1065670 for ; Sat, 5 Feb 2011 12:57:50 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id A8A2D8FC14 for ; Sat, 5 Feb 2011 12:57:50 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.4/8.14.4) with ESMTP id p15CvoT6096363 for ; Sat, 5 Feb 2011 12:57:50 GMT (envelope-from jilles@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id p15CvodF096362 for cvs-src-old@freebsd.org; Sat, 5 Feb 2011 12:57:50 GMT (envelope-from jilles@repoman.freebsd.org) Message-Id: <201102051257.p15CvodF096362@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to jilles@repoman.freebsd.org using -f From: Jilles Tjoelker Date: Sat, 5 Feb 2011 12:54:59 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/bin/sh exec.c sh.1 src/tools/regression/bin/sh/errors bad-binary1.126 X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Feb 2011 12:57:50 -0000 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)