From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-864367-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id 46A591388BF
	for <garchives@archives.gentoo.org>; Fri, 19 Feb 2016 21:34:10 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id CC66F21C067;
	Fri, 19 Feb 2016 21:34:07 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 73DDD21C067
	for <gentoo-commits@lists.gentoo.org>; Fri, 19 Feb 2016 21:34:07 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 3838F340E31
	for <gentoo-commits@lists.gentoo.org>; Fri, 19 Feb 2016 21:34:06 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id AD70715FA
	for <gentoo-commits@lists.gentoo.org>; Fri, 19 Feb 2016 21:34:04 +0000 (UTC)
From: "William Hubbs" <williamh@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" <williamh@gentoo.org>
Message-ID: <1455917153.beaa71df0ab2cfa61beba4be0303099aa6c75e6a.williamh@OpenRC>
Subject: [gentoo-commits] proj/openrc:master commit in: sh/
X-VCS-Repository: proj/openrc
X-VCS-Files: sh/binfmt.sh.in
X-VCS-Directories: sh/
X-VCS-Committer: williamh
X-VCS-Committer-Name: William Hubbs
X-VCS-Revision: beaa71df0ab2cfa61beba4be0303099aa6c75e6a
X-VCS-Branch: master
Date: Fri, 19 Feb 2016 21:34:04 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: 29adade1-5462-4ebb-85c9-821918b15d43
X-Archives-Hash: 785d41c54e9a200c6cb0ce25e12f5e1a

commit:     beaa71df0ab2cfa61beba4be0303099aa6c75e6a
Author:     Dustin C. Hatch <dustin <AT> hatch <DOT> name>
AuthorDate: Fri Feb 19 01:18:13 2016 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Fri Feb 19 21:25:53 2016 +0000
URL:        https://gitweb.gentoo.org/proj/openrc.git/commit/?id=beaa71df

binfmt.sh: use read in raw mode

The read builtin in most shells will interpret backslash characters
as escapes, and they are lost when reading binfmt files line-by-line.
This causes magic strings containing backslashes to be mangled and
become invalid, resulting in erroneous 'invalid entry' messages.

The -r option to read disables special handling of backslashes and
keeps all lines intact.

X-Gentoo-Bug: 575114
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=575114

 sh/binfmt.sh.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sh/binfmt.sh.in b/sh/binfmt.sh.in
index fd422f8..be0ed48 100644
--- a/sh/binfmt.sh.in
+++ b/sh/binfmt.sh.in
@@ -22,7 +22,7 @@ apply_file() {
 
 	### FILE FORMAT ###
 	# See https://www.kernel.org/doc/Documentation/binfmt_misc.txt
-	while read line; do
+	while read -r line; do
 		LINENUM=$(( LINENUM+1 ))
 		case $line in
 			\#*) continue ;;