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

[commits] r10403 - in /fsf/trunk/libc: ChangeLog nss/getent.c



Author: eglibc
Date: Fri May  7 00:05:11 2010
New Revision: 10403

Log:
Import glibc-mainline for 2010-05-07

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/nss/getent.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Fri May  7 00:05:11 2010
@@ -1,4 +1,9 @@
 2010-05-06  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* nss/getent.c (idn_flags): Default to AI_IDN|AI_CANONIDN.
+	(args_options): Add no-idn option.
+	(ahosts_keys_int): Add idn_flags to ai_flags.
+	(parse_option): Handle 'i' option to clear idn_flags.
 
 	* malloc/malloc.c (_int_free): Possible race in the most recently
 	added check.  Only act on the data if no current modification

Modified: fsf/trunk/libc/nss/getent.c
==============================================================================
--- fsf/trunk/libc/nss/getent.c (original)
+++ fsf/trunk/libc/nss/getent.c Fri May  7 00:05:11 2010
@@ -31,6 +31,7 @@
 #include <netdb.h>
 #include <pwd.h>
 #include <shadow.h>
+#include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -56,6 +57,7 @@
 static const struct argp_option args_options[] =
   {
     { "service", 's', "CONFIG", 0, N_("Service configuration to be used") },
+    { "no-idn", 'i', NULL, 0, N_("disable IDN encoding") },
     { NULL, 0, NULL, 0, NULL },
   };
 
@@ -73,6 +75,9 @@
   {
     args_options, parse_option, args_doc, doc, NULL, more_help
   };
+
+/* Additional getaddrinfo flags for IDN encoding.  */
+static int idn_flags = AI_IDN | AI_CANONIDN;
 
 /* Print the version information.  */
 static void
@@ -377,7 +382,8 @@
 
   struct addrinfo hint;
   memset (&hint, '\0', sizeof (hint));
-  hint.ai_flags = AI_V4MAPPED | AI_ADDRCONFIG | AI_CANONNAME | xflags;
+  hint.ai_flags = (AI_V4MAPPED | AI_ADDRCONFIG | AI_CANONNAME
+		   | idn_flags | xflags);
   hint.ai_family = af;
 
   for (i = 0; i < number; ++i)
@@ -861,6 +867,10 @@
 	}
       break;
 
+    case 'i':
+      idn_flags = 0;
+      break;
+
     default:
       return ARGP_ERR_UNKNOWN;
     }