This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch, master, updated. glibc-2.10-130-g5cd1f90


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  5cd1f906c34256abdccc92052fbbde51fd70a565 (commit)
      from  29ba9812bb86bf6da9702f4fbff5cdbb25846401 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=5cd1f906c34256abdccc92052fbbde51fd70a565

commit 5cd1f906c34256abdccc92052fbbde51fd70a565
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Wed Jul 1 03:33:26 2009 -0700

    Fix getent networks lookup and resulting incorrect NSS change.
    
    I changed the files NSS backend for networks because I thought the
    getent use of getnetbyaddr is correct.  But it isn't.  Undo parts
    of the last change and fix getent.

diff --git a/ChangeLog b/ChangeLog
index 714d114..6dfd700 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,10 @@
 2009-07-01  Ulrich Drepper  <drepper@redhat.com>
 
 	* nss/nss_files/files-network.c (netbyaddr): If type is AF_UNSPEC,
-	recognize all types.  Fix endianess in comparison of network number.
+	recognize all types.
 	* nss/getent.c (networks_keys): Pass AF_UNSPEC instead of AF_UNIX
-	to getnetbyaddr.
+	to getnetbyaddr.  Fix network parameter to getnetbyaddr.  It must
+	be in host byte order.
 
 2009-06-26  H.J. Lu  <hongjiu.lu@intel.com>
 
diff --git a/nss/getent.c b/nss/getent.c
index 3a482e1..d70a8da 100644
--- a/nss/getent.c
+++ b/nss/getent.c
@@ -534,7 +534,7 @@ networks_keys (int number, char *key[])
   for (i = 0; i < number; ++i)
     {
       if (isdigit (key[i][0]))
-	net = getnetbyaddr (inet_addr (key[i]), AF_UNSPEC);
+	net = getnetbyaddr (ntohl (inet_addr (key[i])), AF_UNSPEC);
       else
 	net = getnetbyname (key[i]);
 
diff --git a/nss/nss_files/files-network.c b/nss/nss_files/files-network.c
index 064de5a..92aea75 100644
--- a/nss/nss_files/files-network.c
+++ b/nss/nss_files/files-network.c
@@ -82,7 +82,7 @@ DB_LOOKUP (netbyname, ,,
 DB_LOOKUP (netbyaddr, ,,
 	   {
 	     if ((type == AF_UNSPEC || result->n_addrtype == type)
-		 && result->n_net == htonl (net))
+		 && result->n_net == net)
 	       /* Bingo!  */
 	       break;
 	   }, uint32_t net, int type)

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                     |    5 +++--
 nss/getent.c                  |    2 +-
 nss/nss_files/files-network.c |    2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]