Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Nov 2011 02:12:14 +0400
From:      Subbsd <subbsd@gmail.com>
To:        freebsd-stable@freebsd.org
Subject:   suggestion for protection netconfig_ipv4 from empty fields
Message-ID:  <CAFt_eMqfevujdKVSNR39JHa8tXRuHA=yNyTLF9W3dWS_UpoWjA@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFt_eMqfevujdKVSNR39JHa8tXRuHA=yNyTLF9W3dWS_UpoWjA>