shithub: riscv

Download patch

ref: d3773c43550ee5ce00eb3760f1faf58897a224f7
parent: bf2dd0c6bdc79e4e0b048f0c9a19b8bfc09f59d3
author: cinap_lenrek <[email protected]>
date: Sat Jun 1 20:24:42 EDT 2013

aux/wpa: make sure essid is configured, dont make factotum ask for essid

--- a/sys/src/cmd/aux/wpa.c
+++ b/sys/src/cmd/aux/wpa.c
@@ -398,19 +398,19 @@
 	if((fd = dial(addr, nil, devdir, &cfd)) < 0)
 		sysfatal("dial: %r");
 
-	if(essid[0] != 0)
+	if(essid[0] != 0){
 		if(fprint(cfd, "essid %s", essid) < 0)
 			sysfatal("write essid: %r");
+	} else {
+		getessid();
+		if(essid[0] == 0)
+			sysfatal("no essid set");
+	}
 
 	if(prompt){
 		char *s;
 
-		if(essid[0] == 0)
-			getessid();
-		if(essid[0] != 0)
-			s = smprint("proto=wpapsk essid=%q !password?", essid);
-		else
-			s = smprint("proto=wpapsk essid? !password?");
+		s = smprint("proto=wpapsk essid=%q !password?", essid);
 		auth_getkey(s);
 		free(s);
 	}