mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-03 00:10:10 +00:00
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.
This commit is contained in:
parent
29ba9812bb
commit
5cd1f906c3
@ -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>
|
||||
|
||||
|
@ -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]);
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user