From schwab@redhat.com Fri Jul 1 10:29:00 2011 From: schwab@redhat.com (Andreas Schwab) Date: Fri, 01 Jul 2011 10:29:00 -0000 Subject: [PATCH] nss_compat: query NIS domain only when needed Message-ID: 2011-07-01 Andreas Schwab * nis/nss_compat/compat-pwd.c (getpwent_next_nss_netgr): Query NIS domain only when needed. --- nis/nss_compat/compat-pwd.c | 27 +++++++++++++++------------ nis/nss_compat/compat-spwd.c | 27 +++++++++++++++------------ 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/nis/nss_compat/compat-pwd.c b/nis/nss_compat/compat-pwd.c index 6462a85..5107f51 100644 --- a/nis/nss_compat/compat-pwd.c +++ b/nis/nss_compat/compat-pwd.c @@ -361,7 +361,7 @@ getpwent_next_nss_netgr (const char *name, struct passwd *result, ent_t *ent, char *group, char *buffer, size_t buflen, int *errnop) { - char *curdomain, *host, *user, *domain, *p2; + char *curdomain = NULL, *host, *user, *domain, *p2; int status; size_t p2len; @@ -370,15 +370,7 @@ getpwent_next_nss_netgr (const char *name, struct passwd *result, ent_t *ent, if (!nss_getpwnam_r) return NSS_STATUS_UNAVAIL; - if (yp_get_default_domain (&curdomain) != YPERR_SUCCESS) - { - ent->netgroup = false; - ent->first = false; - give_pwd_free (&ent->pwd); - return NSS_STATUS_UNAVAIL; - } - - if (ent->first == true) + if (ent->first) { memset (&ent->netgrdata, 0, sizeof (struct __netgrent)); __internal_setnetgrent (group, &ent->netgrdata); @@ -401,8 +393,19 @@ getpwent_next_nss_netgr (const char *name, struct passwd *result, ent_t *ent, if (user == NULL || user[0] == '-') continue; - if (domain != NULL && strcmp (curdomain, domain) != 0) - continue; + if (domain != NULL) + { + if (curdomain == NULL + && yp_get_default_domain (&curdomain) != YPERR_SUCCESS) + { + __internal_endnetgrent (&ent->netgrdata); + ent->netgroup = false; + give_pwd_free (&ent->pwd); + return NSS_STATUS_UNAVAIL; + } + if (strcmp (curdomain, domain) != 0) + continue; + } /* If name != NULL, we are called from getpwnam. */ if (name != NULL) diff --git a/nis/nss_compat/compat-spwd.c b/nis/nss_compat/compat-spwd.c index 6699259..f33dd3e 100644 --- a/nis/nss_compat/compat-spwd.c +++ b/nis/nss_compat/compat-spwd.c @@ -318,7 +318,7 @@ getspent_next_nss_netgr (const char *name, struct spwd *result, ent_t *ent, char *group, char *buffer, size_t buflen, int *errnop) { - char *curdomain, *host, *user, *domain, *p2; + char *curdomain = NULL, *host, *user, *domain, *p2; size_t p2len; if (!nss_getspnam_r) @@ -328,15 +328,7 @@ getspent_next_nss_netgr (const char *name, struct spwd *result, ent_t *ent, if (ent->setent_status != NSS_STATUS_SUCCESS) return ent->setent_status; - if (yp_get_default_domain (&curdomain) != YPERR_SUCCESS) - { - ent->netgroup = false; - ent->first = false; - give_spwd_free (&ent->pwd); - return NSS_STATUS_UNAVAIL; - } - - if (ent->first == true) + if (ent->first) { memset (&ent->netgrdata, 0, sizeof (struct __netgrent)); __internal_setnetgrent (group, &ent->netgrdata); @@ -361,8 +353,19 @@ getspent_next_nss_netgr (const char *name, struct spwd *result, ent_t *ent, if (user == NULL || user[0] == '-') continue; - if (domain != NULL && strcmp (curdomain, domain) != 0) - continue; + if (domain != NULL) + { + if (curdomain == NULL + && yp_get_default_domain (&curdomain) != YPERR_SUCCESS) + { + __internal_endnetgrent (&ent->netgrdata); + ent->netgroup = false; + give_spwd_free (&ent->pwd); + return NSS_STATUS_UNAVAIL; + } + if (strcmp (curdomain, domain) != 0) + continue; + } /* If name != NULL, we are called from getpwnam */ if (name != NULL) -- 1.7.6 -- Andreas Schwab, schwab@redhat.com GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E "And now for something completely different." From schwab@redhat.com Fri Jul 1 10:42:00 2011 From: schwab@redhat.com (Andreas Schwab) Date: Fri, 01 Jul 2011 10:42:00 -0000 Subject: [PATCH] Define vardbdir relative to prefix Message-ID: 2011-07-01 Andreas Schwab * configure.in (libc_cv_rootsbindir): Substitute. * configure: Regenerate. * config.make.in (localstatedir): Define. * Makeconfig (localstatedir): Define. (vardbdir): Use $(localstatedir). * sysdeps/unix/sysv/linux/configure.in (libc_cv_localstatedir): Set to /var by default. * sysdeps/unix/sysv/linux/configure: Regenerate. --- Makeconfig | 9 ++++++++- config.make.in | 1 + configure | 3 +++ configure.in | 2 ++ sysdeps/unix/sysv/linux/configure | 5 +++++ sysdeps/unix/sysv/linux/configure.in | 5 +++++ 6 files changed, 24 insertions(+), 1 deletions(-) diff --git a/Makeconfig b/Makeconfig index 1110811..8a6cd8b 100644 --- a/Makeconfig +++ b/Makeconfig @@ -291,9 +291,16 @@ sysconfdir = $(prefix)/etc endif inst_sysconfdir = $(install_root)$(sysconfdir) +# Where to install data files which the programs modify +# while they run, and that pertain to one specific machine. +ifndef localstatedir +localstatedir = $(prefix)/var +endif +inst_localstatedir = $(install_root)$(localstatedir) + # Directory for the database files and Makefile for nss_db. ifndef vardbdir -vardbdir = /var/db +vardbdir = $(localstatedir)/db endif inst_vardbdir = $(install_root)$(vardbdir) diff --git a/config.make.in b/config.make.in index 0656b1b..1606b17 100644 --- a/config.make.in +++ b/config.make.in @@ -18,6 +18,7 @@ rootsbindir = @libc_cv_rootsbindir@ infodir = @infodir@ includedir = @includedir@ datarootdir = @datarootdir@ +localstatedir = @libc_cv_localstatedir@ # Should we use and build ldconfig? use-ldconfig = @use_ldconfig@ diff --git a/configure b/configure index 20e7340..9e5c47b 100755 --- a/configure +++ b/configure @@ -627,6 +627,7 @@ libc_cv_cc_avx libc_cv_cc_sse4 libc_cv_cpp_asm_debuginfo libc_cv_forced_unwind +libc_cv_localstatedir libc_cv_rootsbindir libc_cv_sysconfdir libc_cv_localedir @@ -7646,6 +7647,7 @@ sizeof_long_double=$ac_cv_sizeof_long_double use_ldconfig=no ldd_rewrite_script=no libc_cv_sysconfdir=$sysconfdir +libc_cv_localstatedir=$localstatedir libc_cv_gcc_unwind_find_fde=no libc_cv_idn=no @@ -7708,6 +7710,7 @@ fi + if test $elf = yes; then $as_echo "#define HAVE_ELF 1" >>confdefs.h diff --git a/configure.in b/configure.in index f2b3921..127161c 100644 --- a/configure.in +++ b/configure.in @@ -2175,6 +2175,7 @@ AC_SUBST(sizeof_long_double) use_ldconfig=no ldd_rewrite_script=no libc_cv_sysconfdir=$sysconfdir +libc_cv_localstatedir=$localstatedir libc_cv_gcc_unwind_find_fde=no libc_cv_idn=no @@ -2219,6 +2220,7 @@ AC_SUBST(libc_cv_slibdir) AC_SUBST(libc_cv_localedir) AC_SUBST(libc_cv_sysconfdir) AC_SUBST(libc_cv_rootsbindir) +AC_SUBST(libc_cv_localstatedir) AC_SUBST(libc_cv_forced_unwind) dnl sysdeps/CPU/configure.in checks set this via arch-specific asm tests diff --git a/sysdeps/unix/sysv/linux/configure b/sysdeps/unix/sysv/linux/configure index d05bd13..7ed7489 100644 --- a/sysdeps/unix/sysv/linux/configure +++ b/sysdeps/unix/sysv/linux/configure @@ -430,6 +430,11 @@ case "$prefix" in else libc_cv_sysconfdir=$sysconfdir fi + if test $localstatedir = '${prefix}/var'; then + libc_cv_localstatedir=/var + else + libc_cv_localstatedir=$localstatedir + fi libc_cv_rootsbindir="/sbin" ;; esac diff --git a/sysdeps/unix/sysv/linux/configure.in b/sysdeps/unix/sysv/linux/configure.in index 8f00407..8bb8508 100644 --- a/sysdeps/unix/sysv/linux/configure.in +++ b/sysdeps/unix/sysv/linux/configure.in @@ -169,6 +169,11 @@ case "$prefix" in else libc_cv_sysconfdir=$sysconfdir fi + if test $localstatedir = '${prefix}/var'; then + libc_cv_localstatedir=/var + else + libc_cv_localstatedir=$localstatedir + fi libc_cv_rootsbindir="/sbin" ;; esac -- 1.7.6 -- Andreas Schwab, schwab@redhat.com GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E "And now for something completely different." From drepper@gmail.com Fri Jul 1 23:29:00 2011 From: drepper@gmail.com (Ulrich Drepper) Date: Fri, 01 Jul 2011 23:29:00 -0000 Subject: [PATCH] Define vardbdir relative to prefix In-Reply-To: References: Message-ID: On Fri, Jul 1, 2011 at 06:42, Andreas Schwab wrote: > +# Where to install data files which the programs modify > +# while they run, and that pertain to one specific machine. > +ifndef localstatedir > +localstatedir = $(prefix)/var > +endif > +inst_localstatedir = $(install_root)$(localstatedir) > + > ?# Directory for the database files and Makefile for nss_db. > ?ifndef vardbdir > -vardbdir = /var/db > +vardbdir = $(localstatedir)/db This doesn't work because the db files are always searched for in /var/db. This is why the Makefiles are as they are now. What is the reason for this proposed change? From drepper@gmail.com Mon Jul 4 21:54:00 2011 From: drepper@gmail.com (Ulrich Drepper) Date: Mon, 04 Jul 2011 21:54:00 -0000 Subject: [PATCH] Don't use gethostbyaddr to determine canonical name In-Reply-To: References: Message-ID: On Fri, Jun 24, 2011 at 03:49, Andreas Schwab wrote: > $ getent ahosts www.google.de | head -1 > 2a00:1450:8007::6a STREAM www.l.google.com > $ getent ahostsv4 www.google.de | head -1 > 74.125.39.106 ? STREAM fx-in-f106.1e100.net I cannot reproduce this. Must have been on IPv6-day!? What is the exact situation? The patch isn't correct. If anything is wrong then it might be that we need to use the gethostbyname-based implementation in even fewer situations or the getcanon implementation has a problem. The 1e100.net address obviously also belongs to Google. Therefore I'm not really sure there is a problem. They might have directed IPv4 and IPv6 traffic to completely different machines. From schwab@redhat.com Tue Jul 5 08:12:00 2011 From: schwab@redhat.com (Andreas Schwab) Date: Tue, 05 Jul 2011 08:12:00 -0000 Subject: [PATCH] Don't use gethostbyaddr to determine canonical name In-Reply-To: (Ulrich Drepper's message of "Mon, 4 Jul 2011 17:53:57 -0400") References: Message-ID: A PTR isn't a canonical name. See RFC 1034. Andreas. -- Andreas Schwab, schwab@redhat.com GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E "And now for something completely different." From schwab@redhat.com Tue Jul 19 12:27:00 2011 From: schwab@redhat.com (Andreas Schwab) Date: Tue, 19 Jul 2011 12:27:00 -0000 Subject: [PATCH] Fix alloca accounting in strxfm Message-ID: 2011-07-19 Andreas Schwab * string/strxfrm_l.c (STRXFRM): Fix alloca accounting. --- string/strxfrm_l.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/string/strxfrm_l.c b/string/strxfrm_l.c index 351b426..3448f1a 100644 --- a/string/strxfrm_l.c +++ b/string/strxfrm_l.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995-1997,2002,2004-2006,2010 Free Software Foundation, Inc. +/* Copyright (C) 1995-1997,2002,2004-2006,2010,2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Ulrich Drepper , 1995. @@ -150,7 +150,7 @@ STRXFRM (STRING_TYPE *dest, const STRING_TYPE *src, size_t n, __locale_t l) values. But since there is no limit on the length of the string we have to use `malloc' if the string is too long. We should be very conservative here. */ - if (! __libc_use_alloca (srclen)) + if (! __libc_use_alloca ((srclen + 1) * (sizeof (int32_t) + 1))) { idxarr = (int32_t *) malloc ((srclen + 1) * (sizeof (int32_t) + 1)); rulearr = (unsigned char *) &idxarr[srclen]; -- 1.7.6 -- Andreas Schwab, schwab@redhat.com GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E "And now for something completely different." From schwab@redhat.com Tue Jul 19 12:35:00 2011 From: schwab@redhat.com (Andreas Schwab) Date: Tue, 19 Jul 2011 12:35:00 -0000 Subject: [PATCH] nscd: don't crash if killed early Message-ID: 2011-07-19 Andreas Schwab * nscd/nscd.c (main): Don't install termination_handler until after databases are initialized. --- nscd/nscd.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/nscd/nscd.c b/nscd/nscd.c index 4894cb2..3522f6b 100644 --- a/nscd/nscd.c +++ b/nscd/nscd.c @@ -267,9 +267,6 @@ main (int argc, char **argv) if (selinux_enabled) nscd_avc_init (); - signal (SIGINT, termination_handler); - signal (SIGQUIT, termination_handler); - signal (SIGTERM, termination_handler); signal (SIGPIPE, SIG_IGN); /* Cleanup files created by a previous 'bind'. */ @@ -294,6 +291,10 @@ main (int argc, char **argv) /* Init databases. */ nscd_init (); + signal (SIGINT, termination_handler); + signal (SIGQUIT, termination_handler); + signal (SIGTERM, termination_handler); + /* Handle incoming requests */ start_threads (); -- 1.7.6 -- Andreas Schwab, schwab@redhat.com GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E "And now for something completely different." From drepper@gmail.com Tue Jul 19 18:02:00 2011 From: drepper@gmail.com (Ulrich Drepper) Date: Tue, 19 Jul 2011 18:02:00 -0000 Subject: [PATCH] nscd: don't crash if killed early In-Reply-To: References: Message-ID: On Tue, Jul 19, 2011 at 08:35, Andreas Schwab wrote: > 2011-07-19 ?Andreas Schwab ? > > ? ? ? ?* nscd/nscd.c (main): Don't install termination_handler until > ? ? ? ?after databases are initialized. The termination_handler should instead be fixed. Otherwise we might have everything set up and don't tear everything down because the signal handler is not installed. If the head NULL pointer the only problem? From drepper@gmail.com Tue Jul 19 19:05:00 2011 From: drepper@gmail.com (Ulrich Drepper) Date: Tue, 19 Jul 2011 19:05:00 -0000 Subject: [PATCH] Fix alloca accounting in strxfm In-Reply-To: References: Message-ID: On Tue, Jul 19, 2011 at 08:27, Andreas Schwab wrote: > 2011-07-19 ?Andreas Schwab ? > > ? ? ? ?* string/strxfrm_l.c (STRXFRM): Fix alloca accounting. You didn't update the copyright year. From schwab@redhat.com Wed Jul 20 07:31:00 2011 From: schwab@redhat.com (Andreas Schwab) Date: Wed, 20 Jul 2011 07:31:00 -0000 Subject: [PATCH] Fix alloca accounting in strxfm In-Reply-To: (Ulrich Drepper's message of "Tue, 19 Jul 2011 15:04:25 -0400") References: Message-ID: Ulrich Drepper writes: > You didn't update the copyright year. What is the purpose of this stupid remark??? Andreas. -- Andreas Schwab, schwab@redhat.com GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E "And now for something completely different." From schwab@redhat.com Wed Jul 20 08:20:00 2011 From: schwab@redhat.com (Andreas Schwab) Date: Wed, 20 Jul 2011 08:20:00 -0000 Subject: [PATCH] Use size_t for strlen results Message-ID: 2011-07-20 Andreas Schwab * resolv/res_query.c (__libc_res_nquerydomain): Use size_t for strlen results. --- resolv/res_query.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/resolv/res_query.c b/resolv/res_query.c index 26daf0d..67b6136 100644 --- a/resolv/res_query.c +++ b/resolv/res_query.c @@ -543,7 +543,7 @@ __libc_res_nquerydomain(res_state statp, { char nbuf[MAXDNAME]; const char *longname = nbuf; - int n, d; + size_t n, d; #ifdef DEBUG if (statp->options & RES_DEBUG) @@ -560,9 +560,8 @@ __libc_res_nquerydomain(res_state statp, RES_SET_H_ERRNO(statp, NO_RECOVERY); return (-1); } - n--; - if (n >= 0 && name[n] == '.') { - strncpy(nbuf, name, n); + if (n > 0 && name[--n] == '.') { + memcpy(nbuf, name, n); nbuf[n] = '\0'; } else longname = name; -- 1.7.6 -- Andreas Schwab, schwab@redhat.com GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E "And now for something completely different." From drepper@gmail.com Wed Jul 20 15:39:00 2011 From: drepper@gmail.com (Ulrich Drepper) Date: Wed, 20 Jul 2011 15:39:00 -0000 Subject: [PATCH] Fix alloca accounting in strxfm In-Reply-To: References: Message-ID: On Wed, Jul 20, 2011 at 03:30, Andreas Schwab wrote: > What is the purpose of this stupid remark??? Just what it says: you didn't update the year in the copyright comment. That's required. From schwab@redhat.com Thu Jul 21 14:04:00 2011 From: schwab@redhat.com (Andreas Schwab) Date: Thu, 21 Jul 2011 14:04:00 -0000 Subject: [PATCH] Fix AVX check Message-ID: 2011-07-21 Andreas Schwab * sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): Fix last change. (_dl_x86_64_save_sse): Use correct AVX check. --- sysdeps/x86_64/dl-trampoline.S | 21 +++++++++++++++------ 1 files changed, 15 insertions(+), 6 deletions(-) diff --git a/sysdeps/x86_64/dl-trampoline.S b/sysdeps/x86_64/dl-trampoline.S index 1b97929..ad7479f 100644 --- a/sysdeps/x86_64/dl-trampoline.S +++ b/sysdeps/x86_64/dl-trampoline.S @@ -150,7 +150,8 @@ L(have_avx): cmpl $0x6, %eax // Nonzero if SSE and AVX state saving is enabled. sete %al -2: movl %eax, L(have_avx)(%rip) +2: leal -1(%eax,%eax), %eax + movl %eax, L(have_avx)(%rip) cmpl $0, %eax 1: js L(no_avx) @@ -183,11 +184,19 @@ _dl_x86_64_save_sse: movl $1, %eax cpuid movq %r11,%rbx # Restore rbx - movl $1, %eax - testl $(1 << 28), %ecx - jne 2f - negl %eax -2: movl %eax, L(have_avx)(%rip) + xorl %eax, %eax + // AVX and XSAVE supported? + testl $((1 << 28) | (1 << 27)), %ecx + je 2f + xorl %ecx, %ecx + // Get XFEATURE_ENABLED_MASK + xgetbv + andl $0x6, %eax + cmpl $0x6, %eax + // Nonzero if SSE and AVX state saving is enabled. + sete %al +2: leal -1(%eax,%eax), %eax + movl %eax, L(have_avx)(%rip) cmpl $0, %eax 1: js L(no_avx5) -- 1.7.6 -- Andreas Schwab, schwab@redhat.com GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E "And now for something completely different." From schwab@redhat.com Fri Jul 22 11:12:00 2011 From: schwab@redhat.com (Andreas Schwab) Date: Fri, 22 Jul 2011 11:12:00 -0000 Subject: [PATCH] Properly tokenize nameserver line Message-ID: 2011-07-22 Andreas Schwab * resolv/res_init.c (__res_vinit): Properly tokenize nameserver line. --- resolv/res_init.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/resolv/res_init.c b/resolv/res_init.c index 64934b0..73caaa4 100644 --- a/resolv/res_init.c +++ b/resolv/res_init.c @@ -318,7 +318,7 @@ __res_vinit(res_state statp, int preinit) { struct in6_addr a6; char *el; - if ((el = strchr(cp, '\n')) != NULL) + if ((el = strpbrk(cp, " \t\n")) != NULL) *el = '\0'; if ((el = strchr(cp, SCOPE_DELIMITER)) != NULL) *el = '\0'; -- 1.7.6 -- Andreas Schwab, schwab@redhat.com GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E "And now for something completely different." From schwab@redhat.com Mon Jul 25 12:48:00 2011 From: schwab@redhat.com (Andreas Schwab) Date: Mon, 25 Jul 2011 12:48:00 -0000 Subject: [PATCH] Fix inline strncat/strncmp on x86 Message-ID: 2011-07-25 Andreas Schwab * sysdeps/i386/i486/bits/string.h (__strncat_g): Correctly handle __n bigger than INT_MAX+1. (__strncmp_g): Likewise. --- sysdeps/i386/i486/bits/string.h | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sysdeps/i386/i486/bits/string.h b/sysdeps/i386/i486/bits/string.h index 9f05c7e..1f4d837 100644 --- a/sysdeps/i386/i486/bits/string.h +++ b/sysdeps/i386/i486/bits/string.h @@ -1058,8 +1058,8 @@ __strncat_g (char *__dest, __const char __src[], size_t __n) "movl %4, %3\n\t" "decl %1\n\t" "1:\n\t" - "decl %3\n\t" - "js 2f\n\t" + "subl $1,%3\n\t" + "jc 2f\n\t" "movb (%2),%b0\n\t" "movsb\n\t" "testb %b0,%b0\n\t" @@ -1078,8 +1078,8 @@ __strncat_g (char *__dest, __const char __src[], size_t __n) "leal 1(%1),%1\n\t" "jne 1b\n" "2:\n\t" - "decl %3\n\t" - "js 3f\n\t" + "subl $1,%3\n\t" + "jc 3f\n\t" "movb (%2),%b0\n\t" "leal 1(%2),%2\n\t" "movb %b0,(%1)\n\t" @@ -1219,8 +1219,8 @@ __strncmp_g (__const char *__s1, __const char *__s2, size_t __n) register int __res; __asm__ __volatile__ ("1:\n\t" - "decl %3\n\t" - "js 2f\n\t" + "subl $1,%3\n\t" + "jc 2f\n\t" "movb (%1),%b0\n\t" "incl %1\n\t" "cmpb %b0,(%2)\n\t" -- 1.7.6 -- Andreas Schwab, schwab@redhat.com GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E "And now for something completely different." From schwab@redhat.com Tue Jul 26 14:12:00 2011 From: schwab@redhat.com (Andreas Schwab) Date: Tue, 26 Jul 2011 14:12:00 -0000 Subject: [PATCH] Fix encoding name for IDN in getaddrinfo Message-ID: 2011-07-26 Andreas Schwab * sysdeps/posix/getaddrinfo.c (gaih_inet): Don't discard result of encoding to ACE if AI_IDN. --- sysdeps/posix/getaddrinfo.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index 3d6506a..a0d39d4 100644 --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -432,7 +432,10 @@ gaih_inet (const char *name, const struct gaih_service *service, /* In case the output string is the same as the input string no new string has been allocated. */ if (p != name) - malloc_name = true; + { + name = p; + malloc_name = true; + } } #endif -- 1.7.6 -- Andreas Schwab, schwab@redhat.com GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E "And now for something completely different."