From owner-svn-src-all@freebsd.org Mon Dec 12 18:38:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70CFBC720A1; Mon, 12 Dec 2016 18:38:19 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B5B1183B; Mon, 12 Dec 2016 18:38:19 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBCIcIrs069367; Mon, 12 Dec 2016 18:38:18 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBCIcI4X069366; Mon, 12 Dec 2016 18:38:18 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201612121838.uBCIcI4X069366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Mon, 12 Dec 2016 18:38:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309913 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Dec 2016 18:38:19 -0000 Author: dteske Date: Mon Dec 12 18:38:18 2016 New Revision: 309913 URL: https://svnweb.freebsd.org/changeset/base/309913 Log: Allow $BSDINSTALL_TMPETC to contain whitespace or special chars Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig ============================================================================== --- head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 18:36:46 2016 (r309912) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 18:38:18 2016 (r309913) @@ -56,7 +56,7 @@ country_set() if [ "$iface_up" ]; then # Restart wpa_supplicant(8) (should not fail). wpa_supplicant -B -i $WLAN_IFACE -c \ - $BSDINSTALL_TMPETC/wpa_supplicant.conf + "$BSDINSTALL_TMPETC/wpa_supplicant.conf" fi if [ "$error_str" ]; then dialog --backtitle "FreeBSD Installer" --title "Error" \ @@ -68,9 +68,9 @@ country_set() return $SUCCESS # Skip fi else - : > $BSDINSTALL_TMPETC/rc.conf.net.wlan + : > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" echo create_args_$WLAN_IFACE=\"$ifconfig_args\" >> \ - $BSDINSTALL_TMPETC/rc.conf.net.wlan + "$BSDINSTALL_TMPETC/rc.conf.net.wlan" fi return $SUCCESS @@ -142,21 +142,21 @@ dialog_country_select() ############################################################ MAIN -echo -n > $BSDINSTALL_TMPETC/wpa_supplicant.conf -chmod 0600 $BSDINSTALL_TMPETC/wpa_supplicant.conf +echo -n > "$BSDINSTALL_TMPETC/wpa_supplicant.conf" +chmod 0600 "$BSDINSTALL_TMPETC/wpa_supplicant.conf" -echo "ctrl_interface=/var/run/wpa_supplicant" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf -echo "eapol_version=2" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf -echo "ap_scan=1" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf -echo "fast_reauth=1" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf -echo >> $BSDINSTALL_TMPETC/wpa_supplicant.conf +echo "ctrl_interface=/var/run/wpa_supplicant" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" +echo "eapol_version=2" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" +echo "ap_scan=1" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" +echo "fast_reauth=1" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" +echo >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" # # Try to reach wpa_supplicant. If it isn't running and we can modify the # existing system, start it. Otherwise, fail. # (wpa_cli ping >/dev/null 2>/dev/null || ([ "$BSDINSTALL_CONFIGCURRENT" ] && - wpa_supplicant -B -i $1 -c $BSDINSTALL_TMPETC/wpa_supplicant.conf)) || + wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf")) || (dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \ "Could not start wpa_supplicant!" 0 0; exit 1) || exit 1 @@ -260,7 +260,7 @@ echo "network={ scan_ssid=$SCANSSID psk=\"$PASS\" priority=5 -}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf +}" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" elif echo $ENCRYPTION | grep -q EAP; then exec 3>&1 USERPASS=$( dialog --insecure --backtitle "FreeBSD Installer" \ @@ -274,7 +274,7 @@ elif echo $ENCRYPTION | grep -q EAP; the echo "network={ ssid=\"$NETWORK\" scan_ssid=$SCANSSID - key_mgmt=WPA-EAP" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf + key_mgmt=WPA-EAP" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" echo "$USERPASS" | awk ' { if (NR == 1) { @@ -282,9 +282,9 @@ echo "$USERPASS" | awk ' } else if (NR == 2) { printf " password=\"%s\"\n", $1; } -}' >> $BSDINSTALL_TMPETC/wpa_supplicant.conf +}' >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" echo " priority=5 -}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf +}" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" elif echo $ENCRYPTION | grep -q WEP; then exec 3>&1 WEPKEY=$( dialog --insecure --backtitle "FreeBSD Installer" \ @@ -300,21 +300,21 @@ echo "network={ wep_key0=\"$WEPKEY\" wep_tx_keyidx=0 priority=5 -}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf +}" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" else # Open echo "network={ ssid=\"$NETWORK\" scan_ssid=$SCANSSID key_mgmt=NONE priority=5 -}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf +}" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" fi # Connect to any open networks policy echo "network={ priority=0 key_mgmt=NONE -}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf +}" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" # Bring up new network if [ "$BSDINSTALL_CONFIGCURRENT" ]; then