------- Comment From [email protected] 2016-03-18 12:49 EDT-------
Package: netcfg
Version: 1.137
Severity: normal
Tags: d-i

Dear maintainer(s),

when specifying IP addresses with leading or trailing blanks, netcfg does not
correctly identify the IP address and fails.  For example,

Configure a network using static addressing
-------------------------------------------

The IP address is unique to your computer and may be:

* four numbers separated by periods (IPv4);
* blocks of hexadecimal characters separated by colons (IPv6).

You can also optionally append a CIDR netmask (such as "/24").

If you don't know what to use here, consult your network administrator.
IP address:
Prompt: '?' for help> 9.152.162.103
9.152.162.103

!! ERROR: Malformed IP address

The IP address you provided is malformed. It should be in the form x.x.x.x
where each 'x' is no larger than 255 (an IPv4 address), or a sequence of blocks

of hexadecimal digits separated by colons (an IPv6 address). Please try again.
Press enter to continue

This can easily happen, especially, when entering IP addresses within
command line console, such as the z/VM console on z Systems (s390x).

The expected behavior is that leading and trailing blanks should be ignored.
Note that the root cause of the error condition above is triggered by a
failing inet_pton() call which does not expect blanks for an IP address
string.

To correct this behavior, I have attached two patches for discussion:

The first patch removes trailing blanks for the case above. Note that there
is already an rtrim() function that has been reused.  Also an additional
function, strtrim(), is introduced to remove any leading blanks.
The "make test" has been enhanced to verify this behavior.

The second patch removes leading and trailing blanks on IP addresses entered
for other network configurations, for example, point-to-point.

The patch are attached on the related Debian bug report at:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=818611

** Bug watch added: Debian Bug tracker #818611
   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=818611

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1541955

Title:
  installer/netcfg gives misleading error message when parsing line with
  trailing blanks

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/debian-installer/+bug/1541955/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to