From 3ae7e093c27350ced6ffaf99a3bca6bc56c559b8 Mon Sep 17 00:00:00 2001 From: Jim Pryor Date: Tue, 11 Aug 2009 12:49:05 -0400 Subject: respect TMPDIR Signed-off-by: Jim Pryor --- src/connections/wireless | 2 +- src/netcfg-menu | 10 +++++----- src/wireless | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/connections/wireless b/src/connections/wireless index a0191b6..d341e99 100644 --- a/src/connections/wireless +++ b/src/connections/wireless @@ -204,7 +204,7 @@ wireless_down() { fi report_debug wireless_down stop_wpa "$INTERFACE" stop_wpa "$INTERFACE" - [[ "$SECURITY" == "wpa" ]] && rm -rf "/tmp/wpa.${PROFILE// /}" # remove tmp wpa config + [[ "$SECURITY" == "wpa" ]] && rm -rf "${TMPDIR:-/tmp}/wpa.${PROFILE// /}" # remove tmp wpa config report_debug wireless_down iwconfig "$INTERFACE" essid off key off iwconfig "$INTERFACE" essid off key off &> /dev/null # respects quirk nodown---is that appropriate? diff --git a/src/netcfg-menu b/src/netcfg-menu index 21b5651..c5e5324 100644 --- a/src/netcfg-menu +++ b/src/netcfg-menu @@ -26,7 +26,7 @@ fi [ "$NETWORKS_MENU_DEFAULT" ] && DEFAULT="$NETWORKS_MENU_DEFAULT" # if no default yet, use the first entry [ "$DEFAULT" = "" ] && DEFAULT="${profiles[0]}" -ANSWER=$(mktemp /tmp/menu.XXXXXXXX) || exit 1 +ANSWER=$(mktemp --tmpdir menu.XXXXXXXX) || exit 1 # Set timeout if [ "$1" = "" ]; then @@ -38,7 +38,7 @@ fi # Display Dialog dialog --timeout "$TIMEOUT" --default-item "$DEFAULT" \ --menu "Select the network profile you wish to use" \ - 13 50 6 "${profiles[@]}" 2> $ANSWER + 13 50 6 "${profiles[@]}" 2> "$ANSWER" ret=$? @@ -50,15 +50,15 @@ case $ret in if [[ $ret -eq 0 ]]; then echo "$DEFAULT" > "$STATE_DIR/menu"; fi ;; 0) # User selection - profile_up "$(cat $ANSWER)" + profile_up "$(cat "$ANSWER")" ret=$? - if [[ $ret -eq 0 ]]; then mv $ANSWER "$STATE_DIR/menu"; fi + if [[ $ret -eq 0 ]]; then mv "$ANSWER" "$STATE_DIR/menu"; fi ;; *) # Shouldnt happen exit_err "Abnormal ret code from dialog: $ret" ;; esac -rm -f $ANSWER # JP: add -f +rm -f "$ANSWER" # JP: add -f exit $ret # JP: exit with caught $? # vim: set ts=4 et sw=4: diff --git a/src/wireless b/src/wireless index 81a8408..e778627 100644 --- a/src/wireless +++ b/src/wireless @@ -91,7 +91,7 @@ list_networks() # is hard, obscure and kinda nasty. This is simpler and clearer. [[ -z "$INTERFACE" ]] && return 1 - essids=$(mktemp /tmp/essid.XXXXXXXX) + essids=$(mktemp --tmpdir essid.XXXXXXXX) wpa_supplicant -B -i$INTERFACE -Dwext -C/var/run/wpa_supplicant -P/var/run/wpa_supplicant.pid @@ -115,8 +115,8 @@ list_networks() kill $(cat /var/run/wpa_supplicant.pid) # File of 0 length, ie. no ssid's. - if [[ ! -s $essids ]]; then - rm -f $essids + if [[ ! -s "$essids" ]]; then + rm -f "$essids" return 1 fi -- cgit v1.2.3-24-g4f1b