suggestion for protection netconfig_ipv4 from empty fields

Subbsd subbsd at gmail.com
Thu Nov 3 22:12:16 UTC 2011


Hi

In bsdinstaller  on netconfig_ipv4 stage  possible situation of record
with empty values ifconfig in rc.conf.
For this purpose it is necessary on a question
"Would you like to configure IPv4 for this interface" choose "Yes",
then "No" for configuring via DHCP and
in the dialog forms with IP Address, Subnet Mask and GW choose "Ok"
without any data. After this rc.conf will contain:

ifconfig_IF=" inet   netmask "

that isn't critical but generates
"ifconfig: 'netmask' requires argument" warning when netif service start.

I suggest to add similar to this:
==========
--- /usr/libexec/bsdinstall/netconfig_ipv4      2011-11-03
23:47:15.920391101 +0400
+++ /netconfig_ipv4     2011-11-04 01:59:49.573390155 +0400
@@ -69,6 +69,12 @@
        'Default Router' 3 0 "$ROUTER" 3 20 16 0 \
 2>&1 1>&3)
 if [ $? -eq $DIALOG_CANCEL ]; then exit 1; fi
+
+if [ `echo $IF_CONFIG| tr ' ' '\n' |grep -c .` -ne 3 ]; then
+   dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \
+   "All fields should be filled" 0 0
+   exit 1
+fi
 exec 3>&-

 echo $INTERFACE $IF_CONFIG |
==========

Thanks.


More information about the freebsd-stable mailing list