mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-31 14:01:18 +08:00
Convert hostname to lowercase for NIS query.
1998-01-30 Thorsten Kukuk <kukuk@vt.uni-paderborn.de> * nis/nss_nis/nis-hosts.c: Convert hostname to lowercase for NIS query.
This commit is contained in:
parent
6591c33562
commit
cd897fe7c6
@ -1,3 +1,7 @@
|
||||
1998-01-30 Thorsten Kukuk <kukuk@vt.uni-paderborn.de>
|
||||
|
||||
* nis/nss_nis/nis-hosts.c: Convert hostname to lowercase for NIS query.
|
||||
|
||||
1998-01-30 19:58 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* include/cpio.h: Move to ...
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
|
||||
|
||||
@ -259,8 +259,21 @@ _nss_nis_gethostbyname2_r (const char *name, int af, struct hostent *host,
|
||||
*errnop = ERANGE;
|
||||
return NSS_STATUS_TRYAGAIN;
|
||||
}
|
||||
retval = yperr2nss (yp_match (domain, "hosts.byname", name,
|
||||
strlen (name), &result, &len));
|
||||
else
|
||||
{
|
||||
/* Convert name to lowercase. */
|
||||
size_t len = strlen (name);
|
||||
char name2[len + 1];
|
||||
int i;
|
||||
|
||||
for (i = 0; i < len; ++i)
|
||||
name2[i] = tolower (name[i]);
|
||||
name2[i] = '\0';
|
||||
|
||||
retval = yperr2nss (yp_match (domain, "hosts.byname", name2,
|
||||
len, &result, &len));
|
||||
|
||||
}
|
||||
|
||||
if (retval != NSS_STATUS_SUCCESS)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user