about summary refs log tree commit diff
path: root/nis/nss_nis/nis-alias.c
diff options
context:
space:
mode:
Diffstat (limited to 'nis/nss_nis/nis-alias.c')
-rw-r--r--nis/nss_nis/nis-alias.c13
1 files changed, 11 insertions, 2 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)