shithub: riscv

Download patch

ref: 36478171be59721dcc5252043fe2955cb37fc9b3
parent: 88377fc82f0f0feb34798813a7f5fccb8c1941b6
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon Mar 4 14:32:54 EST 2024

bootrc: make sure essid and wpapsk are used literally

bootrc was tokenizing essid and wpapsk fields,
they should be left alone and used as is as
password as well as essid can contain spaces.

--- a/sys/src/9/boot/bootrc
+++ b/sys/src/9/boot/bootrc
@@ -23,7 +23,7 @@
 # reparse variables
 for(i in `{ls -Qp /env}){
 	switch($i){
-	case '*'* 'fn#'* e820 apm0 apid ifs path pid prompt status ?
+	case '*'* 'fn#'* e820 apm0 essid wpapsk apid ifs path pid prompt status ?
 		# ignore these
 	case *
 		$i=`{echo $$i}
--- a/sys/src/9/boot/net.rc
+++ b/sys/src/9/boot/net.rc
@@ -5,7 +5,8 @@
 		if(~ $#essid 0)
 			essid=`{grep '^essid: ' $1/ifstats >[2]/dev/null | sed 's/^essid: //; q'}
 		if(! ~ $#essid 0){
-			x=(aux/wpa -s $"essid)
+			essid=$"essid
+			x=(aux/wpa -s $essid)
 			if(! ~ $#wpapsk 0){
 				echo 'key proto=wpapsk' `{!password=$"wpapsk whatis essid !password} > /mnt/factotum/ctl
 				wpapsk=()