patches/glibc/2.1.3/rh62-02-glibc-2.1.3-locale.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Feb 24 11:00:05 2007 +0000 (2007-02-24)
changeset 1 eeea35fbf182
permissions -rw-r--r--
Add the full crosstool-NG sources to the new repository of its own.
You might just say: 'Yeah! crosstool-NG's got its own repo!".
Unfortunately, that's because the previous repo got damaged beyond repair and I had no backup.
That means I'm putting backups in place in the afternoon.
That also means we've lost history... :-(
     1 2000-08-27  Ulrich Drepper  <drepper@redhat.com>
     2 
     3 	* intl/dcgettext.c (DCGETTEXT): Remove _nl_find_language in code
     4 	to determine invalid locale name.
     5 	* locale/findlocale.c (_nl_find_locale): Likewise.
     6 
     7 2000-08-21  Ulrich Drepper  <drepper@redhat.com>
     8 
     9 	* catgets/catgets.c (catopen): Filter out env_var values with / if
    10 	necessary.
    11 
    12 	* locale/findlocale.c (_nl_find_locale): Move test for unusable
    13 	locale name after all getenvs.
    14 
    15 --- glibc-2.1.3/catgets/catgets.c	2000/01/29 11:56:33	1.15
    16 +++ glibc-2.1.3/catgets/catgets.c	2000/08/21 20:55:30	1.16
    17 @@ -50,7 +50,8 @@
    18  	/* Use the LANG environment variable.  */
    19  	env_var = getenv ("LANG");
    20  
    21 -      if (env_var == NULL)
    22 +      if (env_var == NULL || *env_var == '\0'
    23 +	  || (__libc_enable_secure && strchr (env_var, '/') != NULL))
    24  	env_var = "C";
    25  
    26        env_var_len = strlen (env_var) + 1;
    27 --- glibc-2.1.3/locale/findlocale.c	1999/11/08 23:45:13	1.10.2.1
    28 +++ glibc-2.1.3/locale/findlocale.c	2000/08/21 21:02:42	1.10.2.2
    29 @@ -1,4 +1,4 @@
    30 -/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
    31 +/* Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
    32     This file is part of the GNU C Library.
    33     Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
    34  
    35 @@ -54,11 +54,7 @@
    36    const char *revision;
    37    struct loaded_l10nfile *locale_file;
    38  
    39 -  if ((*name)[0] == '\0'
    40 -      /* In SUID binaries we must not allow people to access files
    41 -	 outside the dedicated locale directories.  */
    42 -      || (__libc_enable_secure
    43 -	  && memchr (*name, '/', _nl_find_language (*name) - *name) != NULL))
    44 +  if ((*name)[0] == '\0')
    45      {
    46        /* The user decides which locale to use by setting environment
    47  	 variables.  */
    48 @@ -67,9 +63,12 @@
    49  	*name = getenv (_nl_category_names[category]);
    50        if (*name == NULL || (*name)[0] == '\0')
    51  	*name = getenv ("LANG");
    52 -      if (*name == NULL || (*name)[0] == '\0')
    53 -	*name = (char *) _nl_C_name;
    54      }
    55 +
    56 +  if (*name == NULL || (*name)[0] == '\0'
    57 +      || (__builtin_expect (__libc_enable_secure, 0)
    58 +	  && strchr (*name, '/') != NULL))
    59 +    *name = (char *) _nl_C_name;
    60  
    61    if (strcmp (*name, _nl_C_name) == 0 || strcmp (*name, _nl_POSIX_name) == 0)
    62      {
    63 --- glibc-2.1.3/intl/dcgettext.c	Sun Aug 27 23:15:33 2000
    64 +++ glibc-2.1.3/intl/dcgettext.c	Sun Aug 27 23:16:34 2000
    65 @@ -371,10 +371,7 @@
    66  
    67  	  /* When this is a SUID binary we must not allow accessing files
    68  	     outside the dedicated directories.  */
    69 -	  if (ENABLE_SECURE
    70 -	      && (memchr (single_locale, '/',
    71 -			  _nl_find_language (single_locale) - single_locale)
    72 -		  != NULL))
    73 +	  if (ENABLE_SECURE && strchr (single_locale, '/') != NULL)
    74  	    /* Ingore this entry.  */
    75  	    continue;
    76  	}