[pkg-wpa-devel] patches for ubuntu wpasupplicant

Kel Modderman kelrin at tpg.com.au
Fri Jun 9 14:48:54 UTC 2006


Hi Reinhard,

Attached are some trivial patches for the ubuntu wpasupplicant that 
shipped with Dapper.

dont-guess-nwid-with-awk.patch
This code should never have been used (/usr/bin/awk!) to get the unique 
network_id. We can trap wpa_cli's output instead.

fix-setnetwork-typos.patch
A series of mistakes in the crowded set_network command area. Trivial 
corrections.

If they do not explain themselves, please do not hesitate to ping me 
about them.

Thanks, Kel.
-------------- next part --------------
diff -Nrup wpasupplicant-ubuntu.orig/debian/wpasupplicant.ifupdown wpasupplicant-ubuntu.patched/debian/wpasupplicant.ifupdown
--- wpasupplicant-ubuntu.orig/debian/wpasupplicant.ifupdown	2006-06-07 20:58:49.000000000 +1000
+++ wpasupplicant-ubuntu.patched/debian/wpasupplicant.ifupdown	2006-06-07 20:58:03.000000000 +1000
@@ -167,11 +167,10 @@ case "$MODE" in 
 		if [ -n "$IF_WPA_SSID" ]; then
 	
 			# append/create network block on first unused network_id
-			NW_ID=$($WPA_CLI_BIN -p $WPA_COMMON_CTRL_IFACE -i $IFACE list_networks | \
-				awk '/^[0-9]+/{ f++ ; if ($1 >= max) max = $1 } END { if (f) print max+1 ; else print 0 }')
+			NW_ID=$($WPA_CLI_BIN -p $WPA_COMMON_CTRL_IFACE -i $IFACE add_network)
 			
 			if [ "$VERBOSITY" = "1" ]; then
-				echo -n "$WPA_SUP_PNAME: configuring new network block, guessing network_id of \"$NW_ID\"? : "
+				echo -n "$WPA_SUP_PNAME: configuring new network block \"$NW_ID\""
 			fi
 		
 			# initialize a new network block
-------------- next part --------------
diff -Nrup wpasupplicant-ubuntu.orig/debian/wpasupplicant.ifupdown wpasupplicant-ubuntu.patched/debian/wpasupplicant.ifupdown
--- wpasupplicant-ubuntu.orig/debian/wpasupplicant.ifupdown	2006-06-07 20:58:49.000000000 +1000
+++ wpasupplicant-ubuntu.patched/debian/wpasupplicant.ifupdown	2006-06-10 00:42:04.000000000 +1000
@@ -440,7 +440,7 @@ case "$MODE" in 
 				fi
 				
 				$WPA_CLI_BIN -p $WPA_COMMON_CTRL_IFACE -i $IFACE \
-					set_network $NW_ID subject_match "\"$IF_WPA_ALTSUBJECT_MATCH\"" >$TO_NULL
+					set_network $NW_ID altsubject_match "\"$IF_WPA_ALTSUBJECT_MATCH\"" >$TO_NULL
 			fi
 			
 			if [ -n "$IF_WPA_CA_CERT2" ]; then
@@ -460,7 +460,7 @@ case "$MODE" in 
 				fi
 				
 				$WPA_CLI_BIN -p $WPA_COMMON_CTRL_IFACE -i $IFACE \
-					set_network $NW_ID ca_path "\"$IF_WPA_CA_PATH2\"" >$TO_NULL
+					set_network $NW_ID ca_path2 "\"$IF_WPA_CA_PATH2\"" >$TO_NULL
 			fi
 		
 			if [ -n "$IF_WPA_CLIENT_CERT2" ]; then
@@ -470,7 +470,7 @@ case "$MODE" in 
 				fi
 				
 				$WPA_CLI_BIN -p $WPA_COMMON_CTRL_IFACE -i $IFACE \
-					set_network $NW_ID client_cert "\"$IF_WPA_CLIENT_CERT2\"" >$TO_NULL
+					set_network $NW_ID client_cert2 "\"$IF_WPA_CLIENT_CERT2\"" >$TO_NULL
 			fi
 		
 			if [ -n "$IF_WPA_PRIVATE_KEY2" ]; then
@@ -480,7 +480,7 @@ case "$MODE" in 
 				fi
 			
 				$WPA_CLI_BIN -p $WPA_COMMON_CTRL_IFACE -i $IFACE \
-					set_network $NW_ID private_key "\"$IF_WPA_PRIVATE_KEY2\"" >$TO_NULL
+					set_network $NW_ID private_key2 "\"$IF_WPA_PRIVATE_KEY2\"" >$TO_NULL
 			fi
 		
 			if [ -n "$IF_WPA_PRIVATE_KEY_PASSWD2" ]; then
@@ -490,7 +490,7 @@ case "$MODE" in 
 				fi
 			
 				$WPA_CLI_BIN -p $WPA_COMMON_CTRL_IFACE -i $IFACE \
-					set_network $NW_ID private_key_passwd "\"$IF_WPA_PRIVATE_KEY_PASSWD2\"" >$TO_NULL
+					set_network $NW_ID private_key_passwd2 "\"$IF_WPA_PRIVATE_KEY_PASSWD2\"" >$TO_NULL
 			fi
 		
 			if [ -n "$IF_WPA_DH_FILE2"  ]; then
@@ -510,7 +510,7 @@ case "$MODE" in 
 				fi
 				
 				$WPA_CLI_BIN -p $WPA_COMMON_CTRL_IFACE -i $IFACE \
-					set_network $NW_ID subject_match "\"$IF_WPA_SUBJECT_MATCH2\"" >$TO_NULL
+					set_network $NW_ID subject_match2 "\"$IF_WPA_SUBJECT_MATCH2\"" >$TO_NULL
 			fi
 		
 			if [ -n "$IF_WPA_ALTSUBJECT_MATCH2" ]; then
@@ -520,7 +520,7 @@ case "$MODE" in 
 				fi
 				
 				$WPA_CLI_BIN -p $WPA_COMMON_CTRL_IFACE -i $IFACE \
-					set_network $NW_ID subject_match "\"$IF_WPA_ALTSUBJECT_MATCH2\"" >$TO_NULL
+					set_network $NW_ID altsubject_match2 "\"$IF_WPA_ALTSUBJECT_MATCH2\"" >$TO_NULL
 			fi
 		
 			if [ -n "$IF_WPA_EAP_METHODS" ]; then
@@ -590,7 +590,7 @@ case "$MODE" in 
 				fi
 				
 				$WPA_CLI_BIN -p $WPA_COMMON_CTRL_IFACE -i $IFACE \
-					set_network $NW_ID engine "\"$IF_WPA_ENGINE_ID\"" >$TO_NULL
+					set_network $NW_ID engine_id "\"$IF_WPA_ENGINE_ID\"" >$TO_NULL
 			fi
 		
 			if [ -n "$IF_WPA_KEY_ID" ]; then
@@ -600,7 +600,7 @@ case "$MODE" in 
 				fi
 				
 				$WPA_CLI_BIN -p $WPA_COMMON_CTRL_IFACE -i $IFACE \
-					set_network $NW_ID engine "\"$IF_WPA_KEY_ID\"" >$TO_NULL
+					set_network $NW_ID key_id "\"$IF_WPA_KEY_ID\"" >$TO_NULL
 			fi
 			
 			if [ -n "$IF_WPA_EAPOL_FLAGS" ]; then


More information about the Pkg-wpa-devel mailing list