[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r8629 - in /fsf/trunk/libc: ./ nis/nss_nis/ nis/nss_nisplus/ nss/ nss/nss_files/



Author: eglibc
Date: Thu Jul  2 00:09:56 2009
New Revision: 8629

Log:
Import glibc-mainline for 2009-07-02

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/nis/nss_nis/nis-network.c
    fsf/trunk/libc/nis/nss_nisplus/nisplus-network.c
    fsf/trunk/libc/nss/getent.c
    fsf/trunk/libc/nss/nss_files/files-network.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Thu Jul  2 00:09:56 2009
@@ -1,3 +1,16 @@
+2009-07-01  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* nis/nss_nis/nis-network.c (_nss_nis_getnetbyaddr_r): Don't use
+	inet_makeaddr.  This worked only with class-based networks.
+	* nis/nss_nisplus/nisplus-network.c (_nss_nisplus_getnetbyaddr_r):
+	Likewise.
+
+	* nss/nss_files/files-network.c (netbyaddr): If type is AF_UNSPEC,
+	recognize all types.
+	* nss/getent.c (networks_keys): Pass AF_UNSPEC instead of AF_UNIX
+	to getnetbyaddr.  Fix network parameter to getnetbyaddr.  It must
+	be in host byte order.
+
 2009-06-26  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
 
 	* sysdeps/x86_64/multiarch/ifunc-defines.sym (FAMILIY_OFFSET): Define.

Modified: fsf/trunk/libc/nis/nss_nis/nis-network.c
==============================================================================
--- fsf/trunk/libc/nis/nss_nis/nis-network.c (original)
+++ fsf/trunk/libc/nis/nss_nis/nis-network.c Thu Jul  2 00:09:56 2009
@@ -241,7 +241,7 @@
   if (__builtin_expect (yp_get_default_domain (&domain), 0))
     return NSS_STATUS_UNAVAIL;
 
-  struct in_addr in = inet_makeaddr (addr, 0);
+  struct in_addr in = { .s_addr = htonl (addr) };
   char *buf = inet_ntoa (in);
   size_t blen = strlen (buf);
 

Modified: fsf/trunk/libc/nis/nss_nisplus/nisplus-network.c
==============================================================================
--- fsf/trunk/libc/nis/nss_nisplus/nisplus-network.c (original)
+++ fsf/trunk/libc/nis/nss_nisplus/nisplus-network.c Thu Jul  2 00:09:56 2009
@@ -433,7 +433,7 @@
     char buf2[18];
     int olderr = errno;
 
-    struct in_addr in = inet_makeaddr (addr, 0);
+    struct in_addr in = { .s_addr = htonl (addr) };
     strcpy (buf2, inet_ntoa (in));
     size_t b2len = strlen (buf2);
 

Modified: fsf/trunk/libc/nss/getent.c
==============================================================================
--- fsf/trunk/libc/nss/getent.c (original)
+++ fsf/trunk/libc/nss/getent.c Thu Jul  2 00:09:56 2009
@@ -534,7 +534,7 @@
   for (i = 0; i < number; ++i)
     {
       if (isdigit (key[i][0]))
-	net = getnetbyaddr (inet_addr (key[i]), AF_UNIX);
+	net = getnetbyaddr (ntohl (inet_addr (key[i])), AF_UNSPEC);
       else
 	net = getnetbyname (key[i]);
 

Modified: fsf/trunk/libc/nss/nss_files/files-network.c
==============================================================================
--- fsf/trunk/libc/nss/nss_files/files-network.c (original)
+++ fsf/trunk/libc/nss/nss_files/files-network.c Thu Jul  2 00:09:56 2009
@@ -1,5 +1,5 @@
 /* Networks file parser in nss_files module.
-   Copyright (C) 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1996-1998, 2000, 2001, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -81,7 +81,8 @@
 
 DB_LOOKUP (netbyaddr, ,,
 	   {
-	     if (result->n_addrtype == type && result->n_net == net)
+	     if ((type == AF_UNSPEC || result->n_addrtype == type)
+		 && result->n_net == net)
 	       /* Bingo!  */
 	       break;
 	   }, uint32_t net, int type)