Skip to content

Commit

Permalink
binfmt.sh: use read in raw mode
Browse files Browse the repository at this point in the history
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
  • Loading branch information
AdmiralNemo authored and williamh committed Feb 19, 2016
1 parent 7eaf711 commit beaa71d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sh/binfmt.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 ;;
Expand Down

0 comments on commit beaa71d

Please sign in to comment.