From owner-freebsd-stable@FreeBSD.ORG Thu Nov 3 22:12:16 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CDB31065743 for ; Thu, 3 Nov 2011 22:12:16 +0000 (UTC) (envelope-from subbsd@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id BCF028FC13 for ; Thu, 3 Nov 2011 22:12:15 +0000 (UTC) Received: by vws11 with SMTP id 11so2470064vws.13 for ; Thu, 03 Nov 2011 15:12:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=z0NG0EmnuF+IFjKMXSFHslcVd9WiVG4OGz0t51NII1Q=; b=vHrQAVU/lYXSgN3LaNyr7urlFSJ5AYxOg16I/cO/7UuDJQ2gf2jc68Hl2cKeADD2Gg JSm0hGkFPws+YIp+tEOwxyCUQarSaE6kkwNCc9tppkfGs3V8B2eh/1MAMzFUFaVHiyuO ATk4i97fYwpBd9RzxyQhq9DFQUxBWu+o7FSmA= MIME-Version: 1.0 Received: by 10.52.20.33 with SMTP id k1mr12001341vde.12.1320358334798; Thu, 03 Nov 2011 15:12:14 -0700 (PDT) Received: by 10.220.160.197 with HTTP; Thu, 3 Nov 2011 15:12:14 -0700 (PDT) Date: Fri, 4 Nov 2011 02:12:14 +0400 Message-ID: From: Subbsd To: freebsd-stable@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: suggestion for protection netconfig_ipv4 from empty fields X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Nov 2011 22:12:16 -0000 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.