Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/openrc:master commit in: sh/
Date: Fri, 19 Feb 2016 21:34:10
Message-Id: 1455917153.beaa71df0ab2cfa61beba4be0303099aa6c75e6a.williamh@OpenRC
1 commit: beaa71df0ab2cfa61beba4be0303099aa6c75e6a
2 Author: Dustin C. Hatch <dustin <AT> hatch <DOT> name>
3 AuthorDate: Fri Feb 19 01:18:13 2016 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Fri Feb 19 21:25:53 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=beaa71df
7
8 binfmt.sh: use read in raw mode
9
10 The read builtin in most shells will interpret backslash characters
11 as escapes, and they are lost when reading binfmt files line-by-line.
12 This causes magic strings containing backslashes to be mangled and
13 become invalid, resulting in erroneous 'invalid entry' messages.
14
15 The -r option to read disables special handling of backslashes and
16 keeps all lines intact.
17
18 X-Gentoo-Bug: 575114
19 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=575114
20
21 sh/binfmt.sh.in | 2 +-
22 1 file changed, 1 insertion(+), 1 deletion(-)
23
24 diff --git a/sh/binfmt.sh.in b/sh/binfmt.sh.in
25 index fd422f8..be0ed48 100644
26 --- a/sh/binfmt.sh.in
27 +++ b/sh/binfmt.sh.in
28 @@ -22,7 +22,7 @@ apply_file() {
29
30 ### FILE FORMAT ###
31 # See https://www.kernel.org/doc/Documentation/binfmt_misc.txt
32 - while read line; do
33 + while read -r line; do
34 LINENUM=$(( LINENUM+1 ))
35 case $line in
36 \#*) continue ;;