Bug 484082 - [RHEL5] getent networks splitting 'aliases' with commas and not spaces
[RHEL5] getent networks splitting 'aliases' with commas and not spaces
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: glibc (Show other bugs)
All Linux
medium Severity medium
: rc
: ---
Assigned To: Jakub Jelinek
: 592001 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2009-02-04 12:18 EST by Jeff Bastian
Modified: 2016-11-24 10:41 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 484079
Last Closed: 2009-09-02 07:45:08 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jeff Bastian 2009-02-04 12:18:37 EST
+++ This bug was initially created as a clone of Bug #484079 +++

Escalated to Bugzilla from IssueTracker

--- Additional comment from tao@redhat.com on 2009-02-04 12:13:44 EDT ---

Description of problem:
regardless of using ldap or nis as the backend, running "getent networks" shows network map entries with the "aliases" list separated by commas, which doesn't appear to make sense.

Solaris doesn't do this and the format of the /etc/networks file (as defined in oses that have a manpage for it) doesn't contain commas, so... why?

How reproducible: always

Steps to Reproduce:

Actual results:
network_name network_number alias1, alias2, alias3,...

Expected results:
network_name network_number alias1 alias2 alias3...

Additional info:
this is observed on RHEL3, 4 and 5
This event sent from IssueTracker by jbastian  [Support Engineering Group]
 issue 137523

--- Additional comment from tao@redhat.com on 2009-02-04 12:13:45 EDT ---

I don't see a current man page on the system for this, but find an
archived one which meshes with the understanding here:

NETWORKS(5)               Linux System Administration             

       networks - network name information

       The file /etc/networks is a plain ASCII file that describes known
       networks and symbolic names for these networks.  Each line
represents a
       network and has the following structure:

              name number aliases ...

       where  the  fields  are  delimited  by spaces or tabs.  Empty lines
       ignored.  If a line contains a hash mark (#), the  hash  mark  and 
       remaining part of the line are ignored.

       The field descriptions are:

       name   The symbolic name for the network.

       number The official number for this network in dotted-decimal
              The trailing ".0" may be omitted.

              Optional aliases for the network.

       This file is read by route or netstat utilities.  Only Class A, B
or  C
       networks  are  supported, partitioned networks (i.e. network/26 or
       work/28) are not supported by this facility.

              The networks definition file.

       getnetbyaddr(3), getnetbyname(3), getnetent(3), route(8),

GNU/Linux                         2001-12-22                      

In simple testing, this turns up:

[root@dl585 RPMS]# grep networks /etc/nsswitch.conf 
#networks:  ldap [NOTFOUND=return] files
networks:   files
[root@dl585 RPMS]# cat /etc/networks
loopback foo bar baz fooble
[root@dl585 RPMS]# getent networks
loopback     foo, bar, baz, fooble
[root@dl585 RPMS]# rpm -q glibc

This event sent from IssueTracker by jbastian  [Support Engineering Group]
 issue 137523

--- Additional comment from tao@redhat.com on 2009-02-04 12:13:46 EDT ---

The fix for this is obviously fairly straightforward:


--- /tmp/redhat/BUILD/glibc-2.5-20061008T1257/nss/getent.c      2006-01-02
00:45:56.000000000 +0530
+++ /tmp/redhat/BUILD/glibc-2.5-20061008T1257/nss/getent-mkpai.c       
2009-01-27 23:12:18.000000000 +0530
@@ -433,7 +433,7 @@
       fputs_unlocked (net->n_aliases[i], stdout);
       if (net->n_aliases[i] != NULL)
-       putchar_unlocked (',');
+       putchar_unlocked (' ');
   putchar_unlocked ('\n');


The 2 concerns are:

1) What else will break if we "correct" this behavior?
2) What was the rationale (if any) for doing it this way?

This event sent from IssueTracker by jbastian  [Support Engineering Group]
 issue 137523

--- Additional comment from tao@redhat.com on 2009-02-04 12:13:48 EDT ---

Hello Frank,

The comma has been removed upstream.

Please see my tech-list query and Ulrich's response

Does this call for 3 separate BZs ?

-- Pai

This event sent from IssueTracker by jbastian  [Support Engineering Group]
 issue 137523
Comment 4 Chris Ward 2009-07-03 14:23:14 EDT
~~ Attention - RHEL 5.4 Beta Released! ~~

RHEL 5.4 Beta has been released! There should be a fix present in the Beta release that addresses this particular request. Please test and report back results here, at your earliest convenience. RHEL 5.4 General Availability release is just around the corner!

If you encounter any issues while testing Beta, please describe the issues you have encountered and set the bug into NEED_INFO. If you encounter new issues, please clone this bug to open a new issue and request it be reviewed for inclusion in RHEL 5.4 or a later update, if it is not of urgent severity.

Please do not flip the bug status to VERIFIED. Only post your verification results, and if available, update Verified field with the appropriate value.

Questions can be posted to this bug or your customer or partner representative.
Comment 7 errata-xmlrpc 2009-09-02 07:45:08 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

Comment 8 Andreas Schwab 2010-07-07 11:30:23 EDT
*** Bug 592001 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.