aboutsummaryrefslogtreecommitdiff
path: root/nis
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-02-17 15:51:21 +0000
committerUlrich Drepper <drepper@redhat.com>1998-02-17 15:51:21 +0000
commitb112c02fa26967dc8d5aa26dcbe3701821eee6f1 (patch)
treeff281bcb35e4455570555dfab76ecaa82ad3063a /nis
parent0a61487785ff1f13ce3bb683cd59e520bbb0086f (diff)
downloadglibc-b112c02fa26967dc8d5aa26dcbe3701821eee6f1.tar
glibc-b112c02fa26967dc8d5aa26dcbe3701821eee6f1.tar.gz
glibc-b112c02fa26967dc8d5aa26dcbe3701821eee6f1.tar.bz2
glibc-b112c02fa26967dc8d5aa26dcbe3701821eee6f1.zip
Update.
1998-02-17 Andreas Jaeger <aj@arthur.rhein-neckar.de> * math/libm.map: Move all symbols that are new in glibc 2.1 to version GLIBC_2.1. 1998-02-17 Ulrich Drepper <drepper@cygnus.com> * stdio-common/vfscanf.c (inchar): Check c for being EOF before trying to read another character. 1998-02-05 Andreas Jaeger <aj@arthur.rhein-neckar.de> * nis/nss_nis/nis-alias.c (_nss_nis_getaliasbyname_r): Convert name to lowercase. * nis/nss_nis/nis-network.c (_nss_nis_getnetbyname_r): Convert name to lowercase, add test for big enough buffer. 1998-02-03 Andreas Jaeger <aj@arthur.rhein-neckar.de> * sysdeps/unix/sysv/linux/alpha/rt_sigaction.S (rt_sigreturn): Make compatible with older kernels. Patch by Richard Henderson.
Diffstat (limited to 'nis')
-rw-r--r--nis/nss_nis/nis-alias.c13
-rw-r--r--nis/nss_nis/nis-network.c25
2 files changed, 33 insertions, 5 deletions
diff --git a/nis/nss_nis/nis-alias.c b/nis/nss_nis/nis-alias.c
index 6ef23012b8..50f08d2e0c 100644
--- a/nis/nss_nis/nis-alias.c
+++ b/nis/nss_nis/nis-alias.c
@@ -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.
@@ -228,6 +228,9 @@ _nss_nis_getaliasbyname_r (const char *name, struct aliasent *alias,
char *result;
int len;
char *p;
+ size_t namlen = strlen (name);
+ char name2[namlen + 1];
+ int i;
if (name == NULL)
{
@@ -238,8 +241,14 @@ _nss_nis_getaliasbyname_r (const char *name, struct aliasent *alias,
if (yp_get_default_domain (&domain))
return NSS_STATUS_UNAVAIL;
- retval = yperr2nss (yp_match (domain, "mail.aliases", name, strlen (name),
+ /* Convert name to lowercase. */
+ for (i = 0; i < namlen; ++i)
+ name2[i] = tolower (name[i]);
+ name2[i] = '\0';
+
+ retval = yperr2nss (yp_match (domain, "mail.aliases", name2, namlen,
&result, &len));
+
if (retval != NSS_STATUS_SUCCESS)
{
if (retval == NSS_STATUS_TRYAGAIN)
diff --git a/nis/nss_nis/nis-network.c b/nis/nss_nis/nis-network.c
index 93cff5ce93..802c03229e 100644
--- a/nis/nss_nis/nis-network.c
+++ b/nis/nss_nis/nis-network.c
@@ -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.
@@ -179,8 +179,27 @@ _nss_nis_getnetbyname_r (const char *name, struct netent *net, char *buffer,
if (yp_get_default_domain (&domain))
return NSS_STATUS_UNAVAIL;
- retval = yperr2nss (yp_match (domain, "networks.byname", name,
- strlen (name), &result, &len));
+ if (buflen < sizeof *data + 1)
+ {
+ *herrnop = NETDB_INTERNAL;
+ *errnop = ERANGE;
+ return NSS_STATUS_TRYAGAIN;
+ }
+ else
+ {
+ /* Convert name to lowercase. */
+ size_t namlen = strlen (name);
+ char name2[namlen + 1];
+ int i;
+
+ for (i = 0; i < namlen; ++i)
+ name2[i] = tolower (name[i]);
+ name2[i] = '\0';
+
+ retval = yperr2nss (yp_match (domain, "networks.byname", name2,
+ namlen, &result, &len));
+ }
+
if (retval != NSS_STATUS_SUCCESS)
{