Date: Fri, 5 Jul 2013 23:16:56 +0000 (UTC) From: Devin Teske <dteske@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252853 - in head/usr.sbin/bsdconfig/networking: include share Message-ID: <201307052316.r65NGut2020144@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dteske Date: Fri Jul 5 23:16:56 2013 New Revision: 252853 URL: http://svnweb.freebsd.org/changeset/base/252853 Log: 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) Modified: head/usr.sbin/bsdconfig/networking/include/messages.subr head/usr.sbin/bsdconfig/networking/share/device.subr head/usr.sbin/bsdconfig/networking/share/ipaddr.subr head/usr.sbin/bsdconfig/networking/share/media.subr head/usr.sbin/bsdconfig/networking/share/netmask.subr head/usr.sbin/bsdconfig/networking/share/routing.subr Modified: head/usr.sbin/bsdconfig/networking/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/include/messages.subr Fri Jul 5 23:13:54 2013 (r252852) +++ head/usr.sbin/bsdconfig/networking/include/messages.subr Fri Jul 5 23:16:56 2013 (r252853) @@ -73,7 +73,7 @@ msg_network_configuration="%s Network Co 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" Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Fri Jul 5 23:13:54 2013 (r252852) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Fri Jul 5 23:16:56 2013 (r252853) @@ -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 # Modified: head/usr.sbin/bsdconfig/networking/share/ipaddr.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Fri Jul 5 23:13:54 2013 (r252852) +++ head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Fri Jul 5 23:16:56 2013 (r252853) @@ -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" )" Modified: head/usr.sbin/bsdconfig/networking/share/media.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/media.subr Fri Jul 5 23:13:54 2013 (r252852) +++ head/usr.sbin/bsdconfig/networking/share/media.subr Fri Jul 5 23:16:56 2013 (r252853) @@ -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 # Modified: head/usr.sbin/bsdconfig/networking/share/netmask.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/netmask.subr Fri Jul 5 23:13:54 2013 (r252852) +++ head/usr.sbin/bsdconfig/networking/share/netmask.subr Fri Jul 5 23:16:56 2013 (r252853) @@ -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 # Modified: head/usr.sbin/bsdconfig/networking/share/routing.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/routing.subr Fri Jul 5 23:13:54 2013 (r252852) +++ head/usr.sbin/bsdconfig/networking/share/routing.subr Fri Jul 5 23:16:56 2013 (r252853) @@ -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 #
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307052316.r65NGut2020144>