From 9077b8d5605597d870ae898fe4c4d22e52f154a3 Mon Sep 17 00:00:00 2001 From: kn Date: Thu, 21 May 2020 11:54:42 +0000 Subject: Do not treat backslashe as an escape character in hostname.if(5) lines ifstart() should always pass such lines unaltered, especially if they contain "nwid" or "description" lines with arbitrary strings. reported SSIDs such as "Mike's" during installation end as broken; this was because the installer escaped the single quote using backslashes which ended up being treated as escape characters much later during hostname.if parsing in netstart(8). Ok deraadt --- distrib/miniroot/install.sub | 4 ++-- etc/netstart | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index 9a590d22c2d..18b0a35c20b 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: install.sub,v 1.1150 2020/04/05 15:15:42 krw Exp $ +# $OpenBSD: install.sub,v 1.1151 2020/05/21 11:54:41 kn Exp $ # # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback # Copyright (c) 2015, Robert Peichaer @@ -2377,7 +2377,7 @@ ifstart() { # Parse the hostname.if(5) file and fill _cmds array with interface # configuration commands. set -o noglob - while IFS= read -- _line; do + while IFS= read -r -- _line; do parse_hn_line $_line done <$_hn diff --git a/etc/netstart b/etc/netstart index 6726853d135..ad5d7d215af 100644 --- a/etc/netstart +++ b/etc/netstart @@ -1,6 +1,6 @@ #!/bin/sh - # -# $OpenBSD: netstart,v 1.202 2020/01/15 00:19:40 kn Exp $ +# $OpenBSD: netstart,v 1.203 2020/05/21 11:54:41 kn Exp $ # Turn off Strict Bourne shell mode. set +o sh @@ -134,7 +134,7 @@ ifstart() { # Parse the hostname.if(5) file and fill _cmds array with interface # configuration commands. set -o noglob - while IFS= read -- _line; do + while IFS= read -r -- _line; do parse_hn_line $_line done <$_hn -- cgit v1.2.3