Don't prevent the user from hanging their system by changing network

settings while NFS mounts are active; but DO warn them and make the
default action to do nothing. (thanks julian)
This commit is contained in:
Devin Teske 2013-07-05 23:16:56 +00:00
parent e587249b7f
commit 39c229261f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=252853
6 changed files with 16 additions and 17 deletions

View File

@ -73,7 +73,7 @@ msg_network_configuration="%s Network Configuration:\nChoose Save/Exit when fini
msg_network_interfaces="Network Interfaces"
msg_network_management="Network Management"
msg_networking_devices="Networking Devices"
msg_nfs_mounts_may_cause_hang="WARNING! Changing this setting while NFS directories are\nmounted may cause the system to hang. Please exit this\nutility and dismount any/all remaining NFS-mounts before\nattempting to change this setting.\n\n%s"
msg_nfs_mounts_may_cause_hang="WARNING! Changing this setting while NFS directories are\nmounted may cause the system to hang. Are you sure you\nwant to proceed?\n\n%s"
msg_no_network_interfaces="No network interfaces detected."
msg_no_options="No options (Default)"
msg_ok="OK"

View File

@ -263,16 +263,15 @@ f_dialog_menu_netdev_edit()
case "$tag" in
X\ *) break ;;
2\ *) #
# Do not proceed if/when there are NFS-mounts currently
# active. If the network is changed while NFS-exported
# directories are mounted, the system may hang (if any
# NFS mounts are using that interface).
# Proceed cautiously (confirm with the user) if/when NFS-
# mounts are active. If the network on which these mounts
# are made is changed parts of the system may hang.
#
if f_nfs_mounted && ! f_jailed; then
local setting="$( printf "$msg_current_dhcp_status" \
"$interface" "$dhcp_status" )"
f_show_msg "$msg_nfs_mounts_may_cause_hang" "$setting"
continue
f_noyes "$msg_nfs_mounts_may_cause_hang" "$setting" ||
continue
fi
#

View File

@ -146,8 +146,8 @@ f_dialog_input_ipaddr()
if f_nfs_mounted && ! f_jailed; then
local setting="$( printf "$msg_current_ipaddr" \
"$interface" "$_ipaddr" )"
f_show_msg "$msg_nfs_mounts_may_cause_hang" "$setting"
return $FAILURE
f_noyes "$msg_nfs_mounts_may_cause_hang" "$setting" ||
return $FAILURE
fi
local msg="$( printf "$msg_please_enter_new_ip_addr" "$interface" )"

View File

@ -117,8 +117,8 @@ f_dialog_input_options()
if f_nfs_mounted && ! f_jailed; then
local setting="$( printf "$msg_current_options" \
"$interface" "$options" )"
f_show_msg "$msg_nfs_mounts_may_cause_hang" "$setting"
return $FAILURE
f_noyes "$msg_nfs_mounts_may_cause_hang" "$setting" ||
return $FAILURE
fi
local msg="$( printf "$msg_please_enter_mediaopts" "$interface" )"
@ -164,8 +164,8 @@ f_dialog_menu_media_options()
if f_nfs_mounted && ! f_jailed; then
local setting="$( printf "$msg_current_options" \
"$interface" "$_options" )"
f_show_msg "$msg_nfs_mounts_may_cause_hang" "$setting"
return $FAILURE
f_noyes "$msg_nfs_mounts_may_cause_hang" "$setting" ||
return $FAILURE
fi
#

View File

@ -96,8 +96,8 @@ f_dialog_input_netmask()
if f_nfs_mounted && ! f_jailed; then
local setting="$( printf "$msg_current_subnet" \
"$interface" "$_netmask" )"
f_show_msg "$msg_nfs_mounts_may_cause_hang" "$setting"
return $FAILURE
f_noyes "$msg_nfs_mounts_may_cause_hang" "$setting" ||
return $FAILURE
fi
#

View File

@ -74,8 +74,8 @@ f_dialog_input_defaultrouter()
if f_nfs_mounted && ! f_jailed; then
local setting="$( printf "$msg_current_default_router" \
"$defaultrouter" )"
f_show_msg "$msg_nfs_mounts_may_cause_hang" "$setting"
return $FAILURE
f_noyes "$msg_nfs_mounts_may_cause_hang" "$setting" ||
return $FAILURE
fi
#