[Bug 1541955] Re: installer/netcfg gives misleading error message when parsing line with trailing blanks
bugproxy
bugproxy at us.ibm.com
Fri Mar 18 16:59:37 UTC 2016
------- Comment From brueckner at de.ibm.com 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
Foundations Bugs, which is subscribed to netcfg in Ubuntu.
https://bugs.launchpad.net/bugs/1541955
Title:
installer/netcfg gives misleading error message when parsing line with
trailing blanks
Status in debian-installer package in Ubuntu:
Confirmed
Status in netcfg package in Ubuntu:
Confirmed
Bug description:
== Comment: #0 - Thorsten Diehl - 2016-02-04 08:52:12 ==
During the very early phase of the installer (build 416) within the z/VM console, when I enter e.g. the IP address and append by accident one ore more trailing blanks, the IP address is treated as malformed.
Recommendation: leading and trailing blanks should be ignored.
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?
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/debian-installer/+bug/1541955/+subscriptions
More information about the foundations-bugs
mailing list