From da63b57e217c7234c5eb8062b2725602363094e0 Mon Sep 17 00:00:00 2001 From: Carlos O'Donell Date: Wed, 27 Aug 2014 20:26:04 -0400 Subject: [PATCH] Resolves: #1133812 - Remove gconv transliteration loadable modules support (CVE-2014-5119, #1133812). - _nl_find_locale: Improve handling of crafted locale names (CVE-2014-0475, #1133812). --- glibc-rh1133812-1.patch | 199 +++++++++++++ glibc-rh1133812-2.patch | 631 ++++++++++++++++++++++++++++++++++++++++ glibc-rh1133812-3.patch | 474 ++++++++++++++++++++++++++++++ glibc.spec | 16 +- 4 files changed, 1319 insertions(+), 1 deletion(-) create mode 100644 glibc-rh1133812-1.patch create mode 100644 glibc-rh1133812-2.patch create mode 100644 glibc-rh1133812-3.patch diff --git a/glibc-rh1133812-1.patch b/glibc-rh1133812-1.patch new file mode 100644 index 0000000..12b9949 --- /dev/null +++ b/glibc-rh1133812-1.patch @@ -0,0 +1,199 @@ +2014-08-21 Florian Weimer + + [BZ #17187] + * iconv/gconv_trans.c (struct known_trans, search_tree, lock, + trans_compare, open_translit, __gconv_translit_find): + Remove module loading code. + +diff --git a/iconv/gconv_trans.c b/iconv/gconv_trans.c +index 1e25854..d71c029 100644 +--- a/iconv/gconv_trans.c ++++ b/iconv/gconv_trans.c +@@ -238,181 +238,11 @@ __gconv_transliterate (struct __gconv_step *step, + return __GCONV_ILLEGAL_INPUT; + } + +- +-/* Structure to represent results of found (or not) transliteration +- modules. */ +-struct known_trans +-{ +- /* This structure must remain the first member. */ +- struct trans_struct info; +- +- char *fname; +- void *handle; +- int open_count; +-}; +- +- +-/* Tree with results of previous calls to __gconv_translit_find. */ +-static void *search_tree; +- +-/* We modify global data. */ +-__libc_lock_define_initialized (static, lock); +- +- +-/* Compare two transliteration entries. */ +-static int +-trans_compare (const void *p1, const void *p2) +-{ +- const struct known_trans *s1 = (const struct known_trans *) p1; +- const struct known_trans *s2 = (const struct known_trans *) p2; +- +- return strcmp (s1->info.name, s2->info.name); +-} +- +- +-/* Open (maybe reopen) the module named in the struct. Get the function +- and data structure pointers we need. */ +-static int +-open_translit (struct known_trans *trans) +-{ +- __gconv_trans_query_fct queryfct; +- +- trans->handle = __libc_dlopen (trans->fname); +- if (trans->handle == NULL) +- /* Not available. */ +- return 1; +- +- /* Find the required symbol. */ +- queryfct = __libc_dlsym (trans->handle, "gconv_trans_context"); +- if (queryfct == NULL) +- { +- /* We cannot live with that. */ +- close_and_out: +- __libc_dlclose (trans->handle); +- trans->handle = NULL; +- return 1; +- } +- +- /* Get the context. */ +- if (queryfct (trans->info.name, &trans->info.csnames, &trans->info.ncsnames) +- != 0) +- goto close_and_out; +- +- /* Of course we also have to have the actual function. */ +- trans->info.trans_fct = __libc_dlsym (trans->handle, "gconv_trans"); +- if (trans->info.trans_fct == NULL) +- goto close_and_out; +- +- /* Now the optional functions. */ +- trans->info.trans_init_fct = +- __libc_dlsym (trans->handle, "gconv_trans_init"); +- trans->info.trans_context_fct = +- __libc_dlsym (trans->handle, "gconv_trans_context"); +- trans->info.trans_end_fct = +- __libc_dlsym (trans->handle, "gconv_trans_end"); +- +- trans->open_count = 1; +- +- return 0; +-} +- +- + int + internal_function + __gconv_translit_find (struct trans_struct *trans) + { +- struct known_trans **found; +- const struct path_elem *runp; +- int res = 1; +- +- /* We have to have a name. */ +- assert (trans->name != NULL); +- +- /* Acquire the lock. */ +- __libc_lock_lock (lock); +- +- /* See whether we know this module already. */ +- found = __tfind (trans, &search_tree, trans_compare); +- if (found != NULL) +- { +- /* Is this module available? */ +- if ((*found)->handle != NULL) +- { +- /* Maybe we have to reopen the file. */ +- if ((*found)->handle != (void *) -1) +- /* The object is not unloaded. */ +- res = 0; +- else if (open_translit (*found) == 0) +- { +- /* Copy the data. */ +- *trans = (*found)->info; +- (*found)->open_count++; +- res = 0; +- } +- } +- } +- else +- { +- size_t name_len = strlen (trans->name) + 1; +- int need_so = 0; +- struct known_trans *newp; +- +- /* We have to continue looking for the module. */ +- if (__gconv_path_elem == NULL) +- __gconv_get_path (); +- +- /* See whether we have to append .so. */ +- if (name_len <= 4 || memcmp (&trans->name[name_len - 4], ".so", 3) != 0) +- need_so = 1; +- +- /* Create a new entry. */ +- newp = (struct known_trans *) malloc (sizeof (struct known_trans) +- + (__gconv_max_path_elem_len +- + name_len + 3) +- + name_len); +- if (newp != NULL) +- { +- char *cp; +- +- /* Clear the struct. */ +- memset (newp, '\0', sizeof (struct known_trans)); +- +- /* Store a copy of the module name. */ +- newp->info.name = cp = (char *) (newp + 1); +- cp = __mempcpy (cp, trans->name, name_len); +- +- newp->fname = cp; +- +- /* Search in all the directories. */ +- for (runp = __gconv_path_elem; runp->name != NULL; ++runp) +- { +- cp = __mempcpy (__stpcpy ((char *) newp->fname, runp->name), +- trans->name, name_len); +- if (need_so) +- memcpy (cp, ".so", sizeof (".so")); +- +- if (open_translit (newp) == 0) +- { +- /* We found a module. */ +- res = 0; +- break; +- } +- } +- +- if (res) +- newp->fname = NULL; +- +- /* In any case we'll add the entry to our search tree. */ +- if (__tsearch (newp, &search_tree, trans_compare) == NULL) +- { +- /* Yickes, this should not happen. Unload the object. */ +- res = 1; +- /* XXX unload here. */ +- } +- } +- } +- +- __libc_lock_unlock (lock); +- +- return res; ++ /* This function always fails. Transliteration module loading is ++ not implemented. */ ++ return 1; + } +-- +1.9.3 + diff --git a/glibc-rh1133812-2.patch b/glibc-rh1133812-2.patch new file mode 100644 index 0000000..a82994f --- /dev/null +++ b/glibc-rh1133812-2.patch @@ -0,0 +1,631 @@ +commit 585367266923156ac6fb789939a923641ba5aaf4 +Author: Florian Weimer +Date: Wed May 28 14:05:03 2014 +0200 + + manual: Update the locale documentation + +commit 4e8f95a0df7c2300b830ec12c0ae1e161bc8a8a3 +Author: Florian Weimer +Date: Mon May 12 15:24:12 2014 +0200 + + _nl_find_locale: Improve handling of crafted locale names [BZ #17137] + + Prevent directory traversal in locale-related environment variables + (CVE-2014-0475). + +commit d183645616b0533b3acee28f1a95570bffbdf50f +Author: Florian Weimer +Date: Wed May 28 14:41:52 2014 +0200 + + setlocale: Use the heap for the copy of the locale argument + + This avoids alloca calls with potentially large arguments. + +diff -pruN glibc-2.18/locale/findlocale.c glibc-2.18.patched/locale/findlocale.c +--- glibc-2.18/locale/findlocale.c 2013-08-11 04:22:55.000000000 +0530 ++++ glibc-2.18.patched/locale/findlocale.c 2014-08-26 16:14:50.403253778 +0530 +@@ -17,6 +17,7 @@ + . */ + + #include ++#include + #include + #include + #include +@@ -57,6 +58,45 @@ struct loaded_l10nfile *_nl_locale_file_ + + const char _nl_default_locale_path[] attribute_hidden = LOCALEDIR; + ++/* Checks if the name is actually present, that is, not NULL and not ++ empty. */ ++static inline int ++name_present (const char *name) ++{ ++ return name != NULL && name[0] != '\0'; ++} ++ ++/* Checks that the locale name neither extremely long, nor contains a ++ ".." path component (to prevent directory traversal). */ ++static inline int ++valid_locale_name (const char *name) ++{ ++ /* Not set. */ ++ size_t namelen = strlen (name); ++ /* Name too long. The limit is arbitrary and prevents stack overflow ++ issues later. */ ++ if (__glibc_unlikely (namelen > 255)) ++ return 0; ++ /* Directory traversal attempt. */ ++ static const char slashdot[4] = {'/', '.', '.', '/'}; ++ if (__glibc_unlikely (memmem (name, namelen, ++ slashdot, sizeof (slashdot)) != NULL)) ++ return 0; ++ if (namelen == 2 && __glibc_unlikely (name[0] == '.' && name [1] == '.')) ++ return 0; ++ if (namelen >= 3 ++ && __glibc_unlikely (((name[0] == '.' ++ && name[1] == '.' ++ && name[2] == '/') ++ || (name[namelen - 3] == '/' ++ && name[namelen - 2] == '.' ++ && name[namelen - 1] == '.')))) ++ return 0; ++ /* If there is a slash in the name, it must start with one. */ ++ if (__glibc_unlikely (memchr (name, '/', namelen) != NULL) && name[0] != '/') ++ return 0; ++ return 1; ++} + + struct __locale_data * + internal_function +@@ -65,7 +105,7 @@ _nl_find_locale (const char *locale_path + { + int mask; + /* Name of the locale for this category. */ +- char *loc_name; ++ char *loc_name = (char *) *name; + const char *language; + const char *modifier; + const char *territory; +@@ -73,31 +113,39 @@ _nl_find_locale (const char *locale_path + const char *normalized_codeset; + struct loaded_l10nfile *locale_file; + +- if ((*name)[0] == '\0') ++ if (loc_name[0] == '\0') + { + /* The user decides which locale to use by setting environment + variables. */ +- *name = getenv ("LC_ALL"); +- if (*name == NULL || (*name)[0] == '\0') +- *name = getenv (_nl_category_names.str ++ loc_name = getenv ("LC_ALL"); ++ if (!name_present (loc_name)) ++ loc_name = getenv (_nl_category_names.str + + _nl_category_name_idxs[category]); +- if (*name == NULL || (*name)[0] == '\0') +- *name = getenv ("LANG"); ++ if (!name_present (loc_name)) ++ loc_name = getenv ("LANG"); ++ if (!name_present (loc_name)) ++ loc_name = (char *) _nl_C_name; + } + +- if (*name == NULL || (*name)[0] == '\0' +- || (__builtin_expect (__libc_enable_secure, 0) +- && strchr (*name, '/') != NULL)) +- *name = (char *) _nl_C_name; ++ /* We used to fall back to the C locale if the name contains a slash ++ character '/', but we now check for directory traversal in ++ valid_locale_name, so this is no longer necessary. */ + +- if (__builtin_expect (strcmp (*name, _nl_C_name), 1) == 0 +- || __builtin_expect (strcmp (*name, _nl_POSIX_name), 1) == 0) ++ if (__builtin_expect (strcmp (loc_name, _nl_C_name), 1) == 0 ++ || __builtin_expect (strcmp (loc_name, _nl_POSIX_name), 1) == 0) + { + /* We need not load anything. The needed data is contained in + the library itself. */ + *name = (char *) _nl_C_name; + return _nl_C[category]; + } ++ else if (!valid_locale_name (loc_name)) ++ { ++ __set_errno (EINVAL); ++ return NULL; ++ } ++ ++ *name = loc_name; + + /* We really have to load some data. First we try the archive, + but only if there was no LOCPATH environment variable specified. */ +diff -pruN glibc-2.18/locale/setlocale.c glibc-2.18.patched/locale/setlocale.c +--- glibc-2.18/locale/setlocale.c 2013-08-11 04:22:55.000000000 +0530 ++++ glibc-2.18.patched/locale/setlocale.c 2014-08-26 16:14:50.401253764 +0530 +@@ -272,6 +272,8 @@ setlocale (int category, const char *loc + of entries of the form `CATEGORY=VALUE'. */ + const char *newnames[__LC_LAST]; + struct __locale_data *newdata[__LC_LAST]; ++ /* Copy of the locale argument, for in-place splitting. */ ++ char *locale_copy = NULL; + + /* Set all name pointers to the argument name. */ + for (category = 0; category < __LC_LAST; ++category) +@@ -281,7 +283,13 @@ setlocale (int category, const char *loc + if (__builtin_expect (strchr (locale, ';') != NULL, 0)) + { + /* This is a composite name. Make a copy and split it up. */ +- char *np = strdupa (locale); ++ locale_copy = strdup (locale); ++ if (__glibc_unlikely (locale_copy == NULL)) ++ { ++ __libc_rwlock_unlock (__libc_setlocale_lock); ++ return NULL; ++ } ++ char *np = locale_copy; + char *cp; + int cnt; + +@@ -299,6 +307,7 @@ setlocale (int category, const char *loc + { + error_return: + __libc_rwlock_unlock (__libc_setlocale_lock); ++ free (locale_copy); + + /* Bogus category name. */ + ERROR_RETURN; +@@ -391,8 +400,9 @@ setlocale (int category, const char *loc + /* Critical section left. */ + __libc_rwlock_unlock (__libc_setlocale_lock); + +- /* Free the resources (the locale path variable). */ ++ /* Free the resources. */ + free (locale_path); ++ free (locale_copy); + + return composite; + } +diff -pruN glibc-2.18/localedata/Makefile glibc-2.18.patched/localedata/Makefile +--- glibc-2.18/localedata/Makefile 2014-08-26 16:15:22.656474571 +0530 ++++ glibc-2.18.patched/localedata/Makefile 2014-08-26 16:14:50.403253778 +0530 +@@ -77,7 +77,7 @@ locale_test_suite := tst_iswalnum tst_is + + tests = $(locale_test_suite) tst-digits tst-setlocale bug-iconv-trans \ + tst-leaks tst-mbswcs6 tst-xlocale1 tst-xlocale2 bug-usesetlocale \ +- tst-strfmon1 tst-sscanf bug-setlocale1 tst-setlocale2 ++ tst-strfmon1 tst-sscanf bug-setlocale1 tst-setlocale2 tst-setlocale3 + ifeq (yes,$(build-shared)) + ifneq (no,$(PERL)) + tests: $(objpfx)mtrace-tst-leaks +diff -pruN glibc-2.18/localedata/tst-setlocale3.c glibc-2.18.patched/localedata/tst-setlocale3.c +--- glibc-2.18/localedata/tst-setlocale3.c 1970-01-01 05:30:00.000000000 +0530 ++++ glibc-2.18.patched/localedata/tst-setlocale3.c 2014-08-26 16:14:50.403253778 +0530 +@@ -0,0 +1,203 @@ ++/* Regression test for setlocale invalid environment variable handling. ++ Copyright (C) 2014 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#include ++#include ++#include ++#include ++ ++/* The result of setlocale may be overwritten by subsequent calls, so ++ this wrapper makes a copy. */ ++static char * ++setlocale_copy (int category, const char *locale) ++{ ++ const char *result = setlocale (category, locale); ++ if (result == NULL) ++ return NULL; ++ return strdup (result); ++} ++ ++static char *de_locale; ++ ++static void ++setlocale_fail (const char *envstring) ++{ ++ setenv ("LC_CTYPE", envstring, 1); ++ if (setlocale (LC_CTYPE, "") != NULL) ++ { ++ printf ("unexpected setlocale success for \"%s\" locale\n", envstring); ++ exit (1); ++ } ++ const char *newloc = setlocale (LC_CTYPE, NULL); ++ if (strcmp (newloc, de_locale) != 0) ++ { ++ printf ("failed setlocale call \"%s\" changed locale to \"%s\"\n", ++ envstring, newloc); ++ exit (1); ++ } ++} ++ ++static void ++setlocale_success (const char *envstring) ++{ ++ setenv ("LC_CTYPE", envstring, 1); ++ char *newloc = setlocale_copy (LC_CTYPE, ""); ++ if (newloc == NULL) ++ { ++ printf ("setlocale for \"%s\": %m\n", envstring); ++ exit (1); ++ } ++ if (strcmp (newloc, de_locale) == 0) ++ { ++ printf ("setlocale with LC_CTYPE=\"%s\" left locale at \"%s\"\n", ++ envstring, de_locale); ++ exit (1); ++ } ++ if (setlocale (LC_CTYPE, de_locale) == NULL) ++ { ++ printf ("restoring locale \"%s\" with LC_CTYPE=\"%s\": %m\n", ++ de_locale, envstring); ++ exit (1); ++ } ++ char *newloc2 = setlocale_copy (LC_CTYPE, newloc); ++ if (newloc2 == NULL) ++ { ++ printf ("restoring locale \"%s\" following \"%s\": %m\n", ++ newloc, envstring); ++ exit (1); ++ } ++ if (strcmp (newloc, newloc2) != 0) ++ { ++ printf ("representation of locale \"%s\" changed from \"%s\" to \"%s\"", ++ envstring, newloc, newloc2); ++ exit (1); ++ } ++ free (newloc); ++ free (newloc2); ++ ++ if (setlocale (LC_CTYPE, de_locale) == NULL) ++ { ++ printf ("restoring locale \"%s\" with LC_CTYPE=\"%s\": %m\n", ++ de_locale, envstring); ++ exit (1); ++ } ++} ++ ++/* Checks that a known-good locale still works if LC_ALL contains a ++ value which should be ignored. */ ++static void ++setlocale_ignore (const char *to_ignore) ++{ ++ const char *fr_locale = "fr_FR.UTF-8"; ++ setenv ("LC_CTYPE", fr_locale, 1); ++ char *expected_locale = setlocale_copy (LC_CTYPE, ""); ++ if (expected_locale == NULL) ++ { ++ printf ("setlocale with LC_CTYPE=\"%s\" failed: %m\n", fr_locale); ++ exit (1); ++ } ++ if (setlocale (LC_CTYPE, de_locale) == NULL) ++ { ++ printf ("failed to restore locale: %m\n"); ++ exit (1); ++ } ++ unsetenv ("LC_CTYPE"); ++ ++ setenv ("LC_ALL", to_ignore, 1); ++ setenv ("LC_CTYPE", fr_locale, 1); ++ const char *actual_locale = setlocale (LC_CTYPE, ""); ++ if (actual_locale == NULL) ++ { ++ printf ("setlocale with LC_ALL, LC_CTYPE=\"%s\" failed: %m\n", ++ fr_locale); ++ exit (1); ++ } ++ if (strcmp (actual_locale, expected_locale) != 0) ++ { ++ printf ("setlocale under LC_ALL failed: got \"%s\", expected \"%s\"\n", ++ actual_locale, expected_locale); ++ exit (1); ++ } ++ unsetenv ("LC_CTYPE"); ++ setlocale_success (fr_locale); ++ unsetenv ("LC_ALL"); ++ free (expected_locale); ++} ++ ++static int ++do_test (void) ++{ ++ /* The glibc test harness sets this environment variable ++ uncondionally. */ ++ unsetenv ("LC_ALL"); ++ ++ de_locale = setlocale_copy (LC_CTYPE, "de_DE.UTF-8"); ++ if (de_locale == NULL) ++ { ++ printf ("setlocale (LC_CTYPE, \"de_DE.UTF-8\"): %m\n"); ++ return 1; ++ } ++ setlocale_success ("C"); ++ setlocale_success ("en_US.UTF-8"); ++ setlocale_success ("/en_US.UTF-8"); ++ setlocale_success ("//en_US.UTF-8"); ++ setlocale_ignore (""); ++ ++ setlocale_fail ("does-not-exist"); ++ setlocale_fail ("/"); ++ setlocale_fail ("/../localedata/en_US.UTF-8"); ++ setlocale_fail ("en_US.UTF-8/"); ++ setlocale_fail ("en_US.UTF-8/.."); ++ setlocale_fail ("en_US.UTF-8/../en_US.UTF-8"); ++ setlocale_fail ("../localedata/en_US.UTF-8"); ++ { ++ size_t large_length = 1024; ++ char *large_name = malloc (large_length + 1); ++ if (large_name == NULL) ++ { ++ puts ("malloc failure"); ++ return 1; ++ } ++ memset (large_name, '/', large_length); ++ const char *suffix = "en_US.UTF-8"; ++ strcpy (large_name + large_length - strlen (suffix), suffix); ++ setlocale_fail (large_name); ++ free (large_name); ++ } ++ { ++ size_t huge_length = 64 * 1024 * 1024; ++ char *huge_name = malloc (huge_length + 1); ++ if (huge_name == NULL) ++ { ++ puts ("malloc failure"); ++ return 1; ++ } ++ memset (huge_name, 'X', huge_length); ++ huge_name[huge_length] = '\0'; ++ /* Construct a composite locale specification. */ ++ const char *prefix = "LC_CTYPE=de_DE.UTF-8;LC_TIME="; ++ memcpy (huge_name, prefix, strlen (prefix)); ++ setlocale_fail (huge_name); ++ free (huge_name); ++ } ++ ++ return 0; ++} ++ ++#define TEST_FUNCTION do_test () ++#include "../test-skeleton.c" +diff -pruN glibc-2.18/manual/locale.texi glibc-2.18.patched/manual/locale.texi +--- glibc-2.18/manual/locale.texi 2013-08-11 04:22:55.000000000 +0530 ++++ glibc-2.18.patched/manual/locale.texi 2014-08-26 16:14:50.404253785 +0530 +@@ -29,6 +29,7 @@ will follow the conventions preferred by + * Setting the Locale:: How a program specifies the locale + with library functions. + * Standard Locales:: Locale names available on all systems. ++* Locale Names:: Format of system-specific locale names. + * Locale Information:: How to access the information for the locale. + * Formatting Numbers:: A dedicated function to format numbers. + * Yes-or-No Questions:: Check a Response against the locale. +@@ -99,14 +100,16 @@ locale named @samp{espana-castellano} to + most of Spain. + + The set of locales supported depends on the operating system you are +-using, and so do their names. We can't make any promises about what +-locales will exist, except for one standard locale called @samp{C} or +-@samp{POSIX}. Later we will describe how to construct locales. +-@comment (@pxref{Building Locale Files}). ++using, and so do their names, except that the standard locale called ++@samp{C} or @samp{POSIX} always exist. @xref{Locale Names}. ++ ++In order to force the system to always use the default locale, the ++user can set the @code{LC_ALL} environment variable to @samp{C}. + + @cindex combining locales +-A user also has the option of specifying different locales for different +-purposes---in effect, choosing a mixture of multiple locales. ++A user also has the option of specifying different locales for ++different purposes---in effect, choosing a mixture of multiple ++locales. @xref{Locale Categories}. + + For example, the user might specify the locale @samp{espana-castellano} + for most purposes, but specify the locale @samp{usa-english} for +@@ -120,7 +123,7 @@ which locales apply. However, the user + for a particular subset of those purposes. + + @node Locale Categories, Setting the Locale, Choosing Locale, Locales +-@section Categories of Activities that Locales Affect ++@section Locale Categories + @cindex categories for locales + @cindex locale categories + +@@ -128,7 +131,11 @@ The purposes that locales serve are grou + that a user or a program can choose the locale for each category + independently. Here is a table of categories; each name is both an + environment variable that a user can set, and a macro name that you can +-use as an argument to @code{setlocale}. ++use as the first argument to @code{setlocale}. ++ ++The contents of the environment variable (or the string in the second ++argument to @code{setlocale}) has to be a valid locale name. ++@xref{Locale Names}. + + @vtable @code + @comment locale.h +@@ -172,7 +179,7 @@ for affirmative and negative responses. + @comment locale.h + @comment ISO + @item LC_ALL +-This is not an environment variable; it is only a macro that you can use ++This is not a category; it is only a macro that you can use + with @code{setlocale} to set a single locale for all purposes. Setting + this environment variable overwrites all selections by the other + @code{LC_*} variables or @code{LANG}. +@@ -225,13 +232,7 @@ The symbols in this section are defined + @comment ISO + @deftypefun {char *} setlocale (int @var{category}, const char *@var{locale}) + The function @code{setlocale} sets the current locale for category +-@var{category} to @var{locale}. A list of all the locales the system +-provides can be created by running +- +-@pindex locale +-@smallexample +- locale -a +-@end smallexample ++@var{category} to @var{locale}. + + If @var{category} is @code{LC_ALL}, this specifies the locale for all + purposes. The other possible values of @var{category} specify an +@@ -256,10 +257,9 @@ is passed in as @var{locale} parameter. + + When you read the current locale for category @code{LC_ALL}, the value + encodes the entire combination of selected locales for all categories. +-In this case, the value is not just a single locale name. In fact, we +-don't make any promises about what it looks like. But if you specify +-the same ``locale name'' with @code{LC_ALL} in a subsequent call to +-@code{setlocale}, it restores the same combination of locale selections. ++If you specify the same ``locale name'' with @code{LC_ALL} in a ++subsequent call to @code{setlocale}, it restores the same combination ++of locale selections. + + To be sure you can use the returned string encoding the currently selected + locale at a later time, you must make a copy of the string. It is not +@@ -275,20 +275,15 @@ for @var{category}. + If a nonempty string is given for @var{locale}, then the locale of that + name is used if possible. + ++The effective locale name (either the second argument to ++@code{setlocale}, or if the argument is an empty string, the name ++obtained from the process environment) must be valid locale name. ++@xref{Locale Names}. ++ + If you specify an invalid locale name, @code{setlocale} returns a null + pointer and leaves the current locale unchanged. + @end deftypefun + +-The path used for finding locale data can be set using the +-@code{LOCPATH} environment variable. The default path for finding +-locale data is system specific. It is computed from the value given +-as the prefix while configuring the C library. This value normally is +-@file{/usr} or @file{/}. For the former the complete path is: +- +-@smallexample +-/usr/lib/locale +-@end smallexample +- + Here is an example showing how you might use @code{setlocale} to + temporarily switch to a new locale. + +@@ -328,7 +323,7 @@ locale categories, and future versions o + portability, assume that any symbol beginning with @samp{LC_} might be + defined in @file{locale.h}. + +-@node Standard Locales, Locale Information, Setting the Locale, Locales ++@node Standard Locales, Locale Names, Setting the Locale, Locales + @section Standard Locales + + The only locale names you can count on finding on all operating systems +@@ -362,7 +357,94 @@ with the environment, rather than trying + locale explicitly by name. Remember, different machines might have + different sets of locales installed. + +-@node Locale Information, Formatting Numbers, Standard Locales, Locales ++@node Locale Names, Locale Information, Standard Locales, Locales ++@section Locale Names ++ ++The following command prints a list of locales supported by the ++system: ++ ++@pindex locale ++@smallexample ++ locale -a ++@end smallexample ++ ++@strong{Portability Note:} With the notable exception of the standard ++locale names @samp{C} and @samp{POSIX}, locale names are ++system-specific. ++ ++Most locale names follow XPG syntax and consist of up to four parts: ++ ++@smallexample ++@var{language}[_@var{territory}[.@var{codeset}]][@@@var{modifier}] ++@end smallexample ++ ++Beside the first part, all of them are allowed to be missing. If the ++full specified locale is not found, less specific ones are looked for. ++The various parts will be stripped off, in the following order: ++ ++@enumerate ++@item ++codeset ++@item ++normalized codeset ++@item ++territory ++@item ++modifier ++@end enumerate ++ ++For example, the locale name @samp{de_AT.iso885915@@euro} denotes a ++German-language locale for use in Austria, using the ISO-8859-15 ++(Latin-9) character set, and with the Euro as the currency symbol. ++ ++In addition to locale names which follow XPG syntax, systems may ++provide aliases such as @samp{german}. Both categories of names must ++not contain the slash character @samp{/}. ++ ++If the locale name starts with a slash @samp{/}, it is treated as a ++path relative to the configured locale directories; see @code{LOCPATH} ++below. The specified path must not contain a component @samp{..}, or ++the name is invalid, and @code{setlocale} will fail. ++ ++@strong{Portability Note:} POSIX suggests that if a locale name starts ++with a slash @samp{/}, it is resolved as an absolute path. However, ++@theglibc{} treats it as a relative path under the directories listed ++in @code{LOCPATH} (or the default locale directory if @code{LOCPATH} ++is unset). ++ ++Locale names which are longer than an implementation-defined limit are ++invalid and cause @code{setlocale} to fail. ++ ++As a special case, locale names used with @code{LC_ALL} can combine ++several locales, reflecting different locale settings for different ++categories. For example, you might want to use a U.S. locale with ISO ++A4 paper format, so you set @code{LANG} to @samp{en_US.UTF-8}, and ++@code{LC_PAPER} to @samp{de_DE.UTF-8}. In this case, the ++@code{LC_ALL}-style combined locale name is ++ ++@smallexample ++LC_CTYPE=en_US.UTF-8;LC_TIME=en_US.UTF-8;LC_PAPER=de_DE.UTF-8;@dots{} ++@end smallexample ++ ++followed by other category settings not shown here. ++ ++@vindex LOCPATH ++The path used for finding locale data can be set using the ++@code{LOCPATH} environment variable. This variable lists the ++directories in which to search for locale definitions, separated by a ++colon @samp{:}. ++ ++The default path for finding locale data is system specific. A typical ++value for the @code{LOCPATH} default is: ++ ++@smallexample ++/usr/share/locale ++@end smallexample ++ ++The value of @code{LOCPATH} is ignored by privileged programs for ++security reasons, and only the default directory is used. ++ ++@node Locale Information, Formatting Numbers, Locale Names, Locales + @section Accessing Locale Information + + There are several ways to access locale information. The simplest diff --git a/glibc-rh1133812-3.patch b/glibc-rh1133812-3.patch new file mode 100644 index 0000000..9ae2546 --- /dev/null +++ b/glibc-rh1133812-3.patch @@ -0,0 +1,474 @@ +commit 2bf1804182cc4bd671193587c8d5e3de45a9618e +Author: Joseph Myers +Date: Wed Jun 4 23:37:25 2014 +0000 + + Include LOCPATH in default test environment. + + Tests run using the default $(make-test-out) automatically get + GCONV_PATH and LC_ALL set, whether or not those environment variables + are actually needed for the individual test. However, they do not get + LOCPATH set, meaning that a large number of tests have -ENV settings + just to set LOCPATH. + + This patch moves LOCPATH into the default environment used for all + tests, on the principle that like GCONV_PATH any settings needed to + use files associated with the newly built library, rather than any old + installed files, are appropriate to use by default. + + A further motivation is that various tests using .sh files also set + some combination of LC_ALL, GCONV_PATH and LOCPATH. Preferably .sh + files should also use the default environment with any additions + required for the individual test. Now, it was suggested in + that + various Makefile variables used in testing should be derived by + composing the -before-env and -after-env variables used when explicit + environment settings are required. With such a change, it's also + natural for those variables to include the default settings (via some + intermediate makefile variable also used in make-test-out). + + Because some .sh files only set variables that correspond to the + default settings, or a subset thereof, and this applies to more of the + .sh files once LOCPATH is in the default settings, doing so reduces + the size of a revised version of + : scripts + only needing the (expanded) default settings will not need to receive + the separate -before-env and -after-env variables, only the single + variable they do at present. So moving LOCPATH into the default + settings can reduce churn caused by subsequent patches. + + Tested x86_64 and x86. + + * Rules (make-test-out): Include + LOCPATH=$(common-objpfx)localedata in default environment. + * debug/Makefile (tst-chk1-ENV): Remove variable. + (tst-chk2-ENV): Likewise. + (tst-chk3-ENV): Likewise. + (tst-chk4-ENV): Likewise. + (tst-chk5-ENV): Likewise. + (tst-chk6-ENV): Likewise. + (tst-lfschk1-ENV): Likewise. + (tst-lfschk2-ENV): Likewise. + (tst-lfschk3-ENV): Likewise. + (tst-lfschk4-ENV): Likewise. + (tst-lfschk5-ENV): Likewise. + (tst-lfschk6-ENV): Likewise. + * iconvdata/Makefile (bug-iconv6-ENV): Likewise. + (tst-iconv7-ENV): Likewise. + * intl/Makefile (LOCPATH-ENV): Likewise. + (tst-codeset-ENV): Likewise. + (tst-gettext3-ENV): Likewise. + (tst-gettext5-ENV): Likewise. + * libio/Makefile (tst-widetext-ENV): Don't set LOCPATH. + (tst-fopenloc-ENV): Likewise. + (tst-fgetws-ENV): Remove variable. + (tst-ungetwc1-ENV): Likewise. + (tst-ungetwc2-ENV): Likewise. + (bug-ungetwc2-ENV): Likewise. + (tst-swscanf-ENV): Likewise. + (bug-ftell-ENV): Likewise. + (tst-fgetwc-ENV): Likewise. + (tst-fseek-ENV): Likewise. + (tst-ftell-partial-wide-ENV): Likewise. + (tst-ftell-active-handler-ENV): Likewise. + (tst-ftell-append-ENV): Likewise. + * posix/Makefile (tst-fnmatch-ENV): Likewise. + (tst-regexloc-ENV): Likewise. + (bug-regex1-ENV): Likewise. + (tst-regex-ENV): Likewise. + (tst-regex2-ENV): Likewise. + (bug-regex5-ENV): Likewise. + (bug-regex6-ENV): Likewise. + (bug-regex17-ENV): Likewise. + (bug-regex18-ENV): Likewise. + (bug-regex19-ENV): Likewise. + (bug-regex20-ENV): Likewise. + (bug-regex22-ENV): Likewise. + (bug-regex23-ENV): Likewise. + (bug-regex25-ENV): Likewise. + (bug-regex26-ENV): Likewise. + (bug-regex30-ENV): Likewise. + (bug-regex32-ENV): Likewise. + (bug-regex33-ENV): Likewise. + (bug-regex34-ENV): Likewise. + (bug-regex35-ENV): Likewise. + (tst-rxspencer-ENV): Likewise. + (tst-rxspencer-no-utf8-ENV): Likewise. + * stdio-common/Makefile (tst-sprintf-ENV): Likewise. + (tst-sscanf-ENV): Likewise. + (tst-swprintf-ENV): Likewise. + (tst-swscanf-ENV): Likewise. + (test-vfprintf-ENV): Likewise. + (scanf13-ENV): Likewise. + (bug14-ENV): Likewise. + (tst-grouping-ENV): Likewise. + * stdlib/Makefile (tst-strtod-ENV): Likewise. + (tst-strtod3-ENV): Likewise. + (tst-strtod4-ENV): Likewise. + (tst-strtod5-ENV): Likewise. + (testmb2-ENV): Likewise./ + * string/Makefile (tst-strxfrm-ENV): Likewise. + (tst-strxfrm2-ENV): Likewise. + (bug-strcoll1-ENV): Likewise. + (test-strcasecmp-ENV): Likewise. + (test-strncasecmp-ENV): Likewise. + * time/Makefile (tst-strptime-ENV): Likewise. + (tst-ftime_l-ENV): Likewise. + * wcsmbs/Makefile (tst-btowc-ENV): Likewise. + (tst-mbrtowc-ENV): Likewise. + (tst-wcrtomb-ENV): Likewise. + (tst-mbrtowc2-ENV): Likewise. + (tst-c16c32-1-ENV): Likewise. + (tst-mbsnrtowcs-ENV): Likewise. + + localedata/ChangeLog: + * Makefile (TEST_MBWC_ENV): Remove variable. + (tst_iswalnum-ENV): Likewise. + (tst_iswalpha-ENV): Likewise. + (tst_iswcntrl-ENV): Likewise. + (tst_iswctype-ENV): Likewise. + (tst_iswdigit-ENV): Likewise. + (tst_iswgraph-ENV): Likewise. + (tst_iswlower-ENV): Likewise. + (tst_iswprint-ENV): Likewise. + (tst_iswpunct-ENV): Likewise. + (tst_iswspace-ENV): Likewise. + (tst_iswupper-ENV): Likewise. + (tst_iswxdigit-ENV): Likewise. + (tst_mblen-ENV): Likewise. + (tst_mbrlen-ENV): Likewise. + (tst_mbrtowc-ENV): Likewise. + (tst_mbsrtowcs-ENV): Likewise. + (tst_mbstowcs-ENV): Likewise. + (tst_mbtowc-ENV): Likewise. + (tst_strcoll-ENV): Likewise. + (tst_strfmon-ENV): Likewise. + (tst_strxfrm-ENV): Likewise. + (tst_swscanf-ENV): Likewise. + (tst_towctrans-ENV): Likewise. + (tst_towlower-ENV): Likewise. + (tst_towupper-ENV): Likewise. + (tst_wcrtomb-ENV): Likewise. + (tst_wcscat-ENV): Likewise. + (tst_wcschr-ENV): Likewise. + (tst_wcscmp-ENV): Likewise. + (tst_wcscoll-ENV): Likewise. + (tst_wcscpy-ENV): Likewise. + (tst_wcscspn-ENV): Likewise. + (tst_wcslen-ENV): Likewise. + (tst_wcsncat-ENV): Likewise. + (tst_wcsncmp-ENV): Likewise. + (tst_wcsncpy-ENV): Likewise. + (tst_wcspbrk-ENV): Likewise. + (tst_wcsrtombs-ENV): Likewise. + (tst_wcsspn-ENV): Likewise. + (tst_wcsstr-ENV): Likewise. + (tst_wcstod-ENV): Likewise. + (tst_wcstok-ENV): Likewise. + (tst_wcstombs-ENV): Likewise. + (tst_wcswidth-ENV): Likewise. + (tst_wcsxfrm-ENV): Likewise. + (tst_wctob-ENV): Likewise. + (tst_wctomb-ENV): Likewise. + (tst_wctrans-ENV): Likewise. + (tst_wctype-ENV): Likewise. + (tst_wcwidth-ENV): Likewise. + (tst-digits-ENV): Likewise. + (tst-mbswcs6-ENV): Likewise. + (tst-xlocale1-ENV): Likewise. + (tst-xlocale2-ENV): Likewise. + (tst-strfmon1-ENV): Likewise. + (tst-strptime-ENV): Likewise. + (tst-setlocale-ENV): Don't set LOCPATH. + (bug-iconv-trans-ENV): Remove variable. + (tst-sscanf-ENV): Likewise. + (tst-leaks-ENV): Don't set LOCPATH. + (bug-setlocale1-ENV): Remove variable. + (bug-setlocale1-static-ENV): Likewise. + (tst-setlocale2-ENV): Likewise. + +diff --git a/Rules b/Rules +index feb304d..9f1a445 100644 +--- a/Rules ++++ b/Rules +@@ -191,7 +191,8 @@ ifneq "$(strip $(tests) $(xtests) $(test-srcs))" "" + # from the test programs and whatever input files are present. + + make-test-out = $(test-wrapper-env) \ +- GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \ ++ GCONV_PATH=$(common-objpfx)iconvdata \ ++ LOCPATH=$(common-objpfx)localedata LC_ALL=C \ + $($*-ENV) $(host-built-program-cmd) $($*-ARGS) + $(objpfx)%-bp.out: %.input $(objpfx)%-bp + $(make-test-out) > $@ < $(word 1,$^) +diff --git a/debug/Makefile b/debug/Makefile +index b599a22..c284c51 100644 +--- a/debug/Makefile ++++ b/debug/Makefile +@@ -109,18 +109,6 @@ CFLAGS-tst-lfschk3.c = -Wno-format + CFLAGS-tst-lfschk4.cc = -Wno-format + CFLAGS-tst-lfschk5.cc = -Wno-format + CFLAGS-tst-lfschk6.cc = -Wno-format +-tst-chk1-ENV = LOCPATH=$(common-objpfx)localedata +-tst-chk2-ENV = LOCPATH=$(common-objpfx)localedata +-tst-chk3-ENV = LOCPATH=$(common-objpfx)localedata +-tst-chk4-ENV = LOCPATH=$(common-objpfx)localedata +-tst-chk5-ENV = LOCPATH=$(common-objpfx)localedata +-tst-chk6-ENV = LOCPATH=$(common-objpfx)localedata +-tst-lfschk1-ENV = LOCPATH=$(common-objpfx)localedata +-tst-lfschk2-ENV = LOCPATH=$(common-objpfx)localedata +-tst-lfschk3-ENV = LOCPATH=$(common-objpfx)localedata +-tst-lfschk4-ENV = LOCPATH=$(common-objpfx)localedata +-tst-lfschk5-ENV = LOCPATH=$(common-objpfx)localedata +-tst-lfschk6-ENV = LOCPATH=$(common-objpfx)localedata + LDLIBS-tst-chk4 = -lstdc++ + LDLIBS-tst-chk5 = -lstdc++ + LDLIBS-tst-chk6 = -lstdc++ +diff --git a/iconvdata/Makefile b/iconvdata/Makefile +index 074d330..d98b6bd 100644 +--- a/iconvdata/Makefile ++++ b/iconvdata/Makefile +@@ -73,9 +73,6 @@ tests += bug-iconv3 + endif + + test-srcs := tst-table-from tst-table-to +- +-bug-iconv6-ENV = LOCPATH=$(common-objpfx)localedata +-tst-iconv7-ENV = LOCPATH=$(common-objpfx)localedata + endif + + # No code here is in libc.so. +diff --git a/intl/Makefile b/intl/Makefile +index f11449d..10051f6 100644 +--- a/intl/Makefile ++++ b/intl/Makefile +@@ -118,11 +118,6 @@ CFLAGS-tst-gettext4.c = -DOBJPFX=\"$(objpfx)\" + CFLAGS-tst-gettext5.c = -DOBJPFX=\"$(objpfx)\" + CFLAGS-tst-gettext6.c = -DOBJPFX=\"$(objpfx)\" + +-LOCPATH-ENV = LOCPATH=$(common-objpfx)localedata +-tst-codeset-ENV = $(LOCPATH-ENV) +-tst-gettext3-ENV = $(LOCPATH-ENV) +-tst-gettext5-ENV = $(LOCPATH-ENV) +- + ifeq ($(have-thread-library),yes) + ifeq (yes,$(build-shared)) + $(addprefix $(objpfx),$(multithread-test-srcs)): $(shared-thread-library) +diff --git a/libio/Makefile b/libio/Makefile +index b324ccc..4552360 100644 +--- a/libio/Makefile ++++ b/libio/Makefile +@@ -148,17 +148,8 @@ CFLAGS-tst_putwc.c = -DOBJPFX=\"$(objpfx)\" + + tst_wprintf2-ARGS = "Some Text" + +-tst-widetext-ENV = LOCPATH=$(common-objpfx)localedata LANGUAGE=C +-tst-fopenloc-ENV = LOCPATH=$(common-objpfx)localedata \ +- MALLOC_TRACE=$(objpfx)tst-fopenloc.mtrace +-tst-fgetws-ENV = LOCPATH=$(common-objpfx)localedata +-tst-ungetwc1-ENV = LOCPATH=$(common-objpfx)localedata +-tst-ungetwc2-ENV = LOCPATH=$(common-objpfx)localedata +-bug-ungetwc2-ENV = LOCPATH=$(common-objpfx)localedata +-tst-swscanf-ENV = LOCPATH=$(common-objpfx)localedata +-bug-ftell-ENV = LOCPATH=$(common-objpfx)localedata +-tst-fgetwc-ENV = LOCPATH=$(common-objpfx)localedata +-tst-fseek-ENV = LOCPATH=$(common-objpfx)localedata ++tst-widetext-ENV = LANGUAGE=C ++tst-fopenloc-ENV = MALLOC_TRACE=$(objpfx)tst-fopenloc.mtrace + + generated = tst-fopenloc.mtrace tst-fopenloc.check + +diff --git a/localedata/Makefile b/localedata/Makefile +index d7ab445..20da00c 100644 +--- a/localedata/Makefile ++++ b/localedata/Makefile +@@ -215,79 +215,13 @@ + $(addprefix --prefix=,$(install_root)) $$locale; \ + echo ' done'; \ + +-# The mbwc-tests need some environment setup to find the locale data files +-TEST_MBWC_ENV:= LOCPATH=$(common-objpfx)localedata +-tst_iswalnum-ENV = $(TEST_MBWC_ENV) +-tst_iswalpha-ENV = $(TEST_MBWC_ENV) +-tst_iswcntrl-ENV = $(TEST_MBWC_ENV) +-tst_iswctype-ENV = $(TEST_MBWC_ENV) +-tst_iswdigit-ENV = $(TEST_MBWC_ENV) +-tst_iswgraph-ENV = $(TEST_MBWC_ENV) +-tst_iswlower-ENV = $(TEST_MBWC_ENV) +-tst_iswprint-ENV = $(TEST_MBWC_ENV) +-tst_iswpunct-ENV = $(TEST_MBWC_ENV) +-tst_iswspace-ENV = $(TEST_MBWC_ENV) +-tst_iswupper-ENV = $(TEST_MBWC_ENV) +-tst_iswxdigit-ENV = $(TEST_MBWC_ENV) +-tst_mblen-ENV = $(TEST_MBWC_ENV) +-tst_mbrlen-ENV = $(TEST_MBWC_ENV) +-tst_mbrtowc-ENV = $(TEST_MBWC_ENV) +-tst_mbsrtowcs-ENV = $(TEST_MBWC_ENV) +-tst_mbstowcs-ENV = $(TEST_MBWC_ENV) +-tst_mbtowc-ENV = $(TEST_MBWC_ENV) +-tst_strcoll-ENV = $(TEST_MBWC_ENV) +-tst_strfmon-ENV = $(TEST_MBWC_ENV) +-tst_strxfrm-ENV = $(TEST_MBWC_ENV) +-tst_swscanf-ENV = $(TEST_MBWC_ENV) +-tst_towctrans-ENV = $(TEST_MBWC_ENV) +-tst_towlower-ENV = $(TEST_MBWC_ENV) +-tst_towupper-ENV = $(TEST_MBWC_ENV) +-tst_wcrtomb-ENV = $(TEST_MBWC_ENV) +-tst_wcscat-ENV = $(TEST_MBWC_ENV) +-tst_wcschr-ENV = $(TEST_MBWC_ENV) +-tst_wcscmp-ENV = $(TEST_MBWC_ENV) +-tst_wcscoll-ENV = $(TEST_MBWC_ENV) +-tst_wcscpy-ENV = $(TEST_MBWC_ENV) +-tst_wcscspn-ENV = $(TEST_MBWC_ENV) +-tst_wcslen-ENV = $(TEST_MBWC_ENV) +-tst_wcsncat-ENV = $(TEST_MBWC_ENV) +-tst_wcsncmp-ENV = $(TEST_MBWC_ENV) +-tst_wcsncpy-ENV = $(TEST_MBWC_ENV) +-tst_wcspbrk-ENV = $(TEST_MBWC_ENV) +-tst_wcsrtombs-ENV = $(TEST_MBWC_ENV) +-tst_wcsspn-ENV = $(TEST_MBWC_ENV) +-tst_wcsstr-ENV = $(TEST_MBWC_ENV) +-tst_wcstod-ENV = $(TEST_MBWC_ENV) +-tst_wcstok-ENV = $(TEST_MBWC_ENV) +-tst_wcstombs-ENV = $(TEST_MBWC_ENV) +-tst_wcswidth-ENV = $(TEST_MBWC_ENV) +-tst_wcsxfrm-ENV = $(TEST_MBWC_ENV) +-tst_wctob-ENV = $(TEST_MBWC_ENV) +-tst_wctomb-ENV = $(TEST_MBWC_ENV) +-tst_wctrans-ENV = $(TEST_MBWC_ENV) +-tst_wctype-ENV = $(TEST_MBWC_ENV) +-tst_wcwidth-ENV = $(TEST_MBWC_ENV) +-tst-digits-ENV = $(TEST_MBWC_ENV) +-tst-mbswcs6-ENV = $(TEST_MBWC_ENV) +-tst-xlocale1-ENV = $(TEST_MBWC_ENV) +-tst-xlocale2-ENV = $(TEST_MBWC_ENV) +-tst-strfmon1-ENV = $(TEST_MBWC_ENV) +-tst-strptime-ENV = $(TEST_MBWC_ENV) ++tst-setlocale-ENV = LC_ALL=ja_JP.EUC-JP + +-tst-setlocale-ENV = LOCPATH=$(common-objpfx)localedata LC_ALL=ja_JP.EUC-JP +- +-bug-iconv-trans-ENV = LOCPATH=$(common-objpfx)localedata +- +-tst-sscanf-ENV = LOCPATH=$(common-objpfx)localedata +- +-tst-leaks-ENV = MALLOC_TRACE=$(objpfx)tst-leaks.mtrace \ +- LOCPATH=$(common-objpfx)localedata ++tst-leaks-ENV = MALLOC_TRACE=$(objpfx)tst-leaks.mtrace + $(objpfx)mtrace-tst-leaks: $(objpfx)tst-leaks.out + $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks.mtrace > $@ + +-bug-setlocale1-ENV = LOCPATH=$(common-objpfx)localedata + bug-setlocale1-ARGS = $(common-objpfx) +-tst-setlocale2-ENV = LOCPATH=$(common-objpfx)localedata + + $(objdir)/iconvdata/gconv-modules: + $(MAKE) -C ../iconvdata subdir=iconvdata $@ +diff --git a/posix/Makefile b/posix/Makefile +index 328c2c5..3d75971 100644 +--- a/posix/Makefile ++++ b/posix/Makefile +@@ -203,27 +203,7 @@ tst-dir-ARGS = `pwd` `cd $(common-objdir)/$(subdir); pwd` `cd $(common-objdir); + tst-chmod-ARGS = $(objdir) + tst-vfork3-ARGS = --test-dir=$(objpfx) + +-tst-fnmatch-ENV = LOCPATH=$(common-objpfx)localedata +-tst-regexloc-ENV = LOCPATH=$(common-objpfx)localedata +-bug-regex1-ENV = LOCPATH=$(common-objpfx)localedata +-tst-regex-ENV = LOCPATH=$(common-objpfx)localedata +-tst-regex2-ENV = LOCPATH=$(common-objpfx)localedata +-bug-regex5-ENV = LOCPATH=$(common-objpfx)localedata +-bug-regex6-ENV = LOCPATH=$(common-objpfx)localedata +-bug-regex17-ENV = LOCPATH=$(common-objpfx)localedata +-bug-regex18-ENV = LOCPATH=$(common-objpfx)localedata +-bug-regex19-ENV = LOCPATH=$(common-objpfx)localedata +-bug-regex20-ENV = LOCPATH=$(common-objpfx)localedata +-bug-regex22-ENV = LOCPATH=$(common-objpfx)localedata +-bug-regex23-ENV = LOCPATH=$(common-objpfx)localedata +-bug-regex25-ENV = LOCPATH=$(common-objpfx)localedata +-bug-regex26-ENV = LOCPATH=$(common-objpfx)localedata +-bug-regex30-ENV = LOCPATH=$(common-objpfx)localedata +-bug-regex32-ENV = LOCPATH=$(common-objpfx)localedata +-bug-regex33-ENV = LOCPATH=$(common-objpfx)localedata +-bug-regex34-ENV = LOCPATH=$(common-objpfx)localedata + tst-rxspencer-ARGS = --utf8 rxspencer/tests +-tst-rxspencer-ENV = LOCPATH=$(common-objpfx)localedata + tst-pcre-ARGS = PCRE.tests + tst-boost-ARGS = BOOST.tests + bug-glob1-ARGS = "$(objpfx)" +diff --git a/stdio-common/Makefile b/stdio-common/Makefile +index f179eab..5f8e534 100644 +--- a/stdio-common/Makefile ++++ b/stdio-common/Makefile +@@ -118,13 +118,6 @@ CFLAGS-scanf17.c = -I../libio -I../stdlib -I../wcsmbs -I../time -I../string \ + + # We know the test has a format string problem. + CFLAGS-tst-sprintf.c = -Wno-format +-tst-sprintf-ENV = LOCPATH=$(common-objpfx)localedata +-tst-sscanf-ENV = LOCPATH=$(common-objpfx)localedata +-tst-swprintf-ENV = LOCPATH=$(common-objpfx)localedata +-test-vfprintf-ENV = LOCPATH=$(common-objpfx)localedata +-scanf13-ENV = LOCPATH=$(common-objpfx)localedata +-bug14-ENV = LOCPATH=$(common-objpfx)localedata +-tst-grouping-ENV = LOCPATH=$(common-objpfx)localedata + + CPPFLAGS += $(libio-mtsafe) + +diff --git a/stdlib/Makefile b/stdlib/Makefile +index d7a562f..0fdf7cc 100644 +--- a/stdlib/Makefile ++++ b/stdlib/Makefile +@@ -123,11 +123,6 @@ include ../Rules + # Testdir has to be named stdlib and needs to be writable + test-canon-ARGS = --test-dir=${common-objpfx}stdlib + +-tst-strtod-ENV = LOCPATH=$(common-objpfx)localedata +-tst-strtod3-ENV = LOCPATH=$(common-objpfx)localedata +-tst-strtod4-ENV = LOCPATH=$(common-objpfx)localedata +-tst-strtod5-ENV = LOCPATH=$(common-objpfx)localedata +-testmb2-ENV = LOCPATH=$(common-objpfx)localedata + bug-fmtmsg1-ENV = SEV_LEVEL=foo,11,newsev + + # Run a test on the header files we use. +diff --git a/string/Makefile b/string/Makefile +index 5a76872..70b9c19 100644 +--- a/string/Makefile ++++ b/string/Makefile +@@ -67,9 +67,6 @@ include ../Rules + tester-ENV = LANGUAGE=C + inl-tester-ENV = LANGUAGE=C + noinl-tester-ENV = LANGUAGE=C +-tst-strxfrm-ENV = LOCPATH=$(common-objpfx)localedata +-tst-strxfrm2-ENV = LOCPATH=$(common-objpfx)localedata +-bug-strcoll1-ENV = LOCPATH=$(common-objpfx)localedata + CFLAGS-inl-tester.c = -fno-builtin + CFLAGS-noinl-tester.c = -fno-builtin + CFLAGS-tst-strlen.c = -fno-builtin +diff --git a/time/Makefile b/time/Makefile +index b7f3dba..a07c041 100644 +--- a/time/Makefile ++++ b/time/Makefile +@@ -55,7 +55,4 @@ CFLAGS-test_time.c = -Wno-format + tst-getdate-ENV= DATEMSK=datemsk TZDIR=${common-objpfx}timezone/testdata + test_time-ARGS= EST5EDT CST + +-tst-strptime-ENV = LOCPATH=${common-objpfx}localedata +-tst-ftime_l-ENV = LOCPATH=${common-objpfx}localedata +- + bug-getdate1-ARGS = ${objpfx}bug-getdate1-fmt +diff --git a/wcsmbs/Makefile b/wcsmbs/Makefile +index 197ca7d..42843a6 100644 +--- a/wcsmbs/Makefile ++++ b/wcsmbs/Makefile +@@ -80,10 +80,3 @@ CPPFLAGS += $(libio-mtsafe) + + # We need to find the default version of strtold_l in stdlib. + CPPFLAGS-wcstold_l.c = -I../stdlib +- +-tst-btowc-ENV = LOCPATH=$(common-objpfx)localedata +-tst-mbrtowc-ENV = LOCPATH=$(common-objpfx)localedata +-tst-wcrtomb-ENV = LOCPATH=$(common-objpfx)localedata +-tst-mbrtowc2-ENV = LOCPATH=$(common-objpfx)localedata +-tst-c16c32-1-ENV = LOCPATH=$(common-objpfx)localedata +-tst-mbsnrtowcs-ENV = LOCPATH=$(common-objpfx)localedata +--- glibc-2.17-c758a686/localedata/Makefile 2014-08-26 21:38:56.564751630 +0530 ++++ glibc-2.17-c758a686/localedata/Makefile.new 2014-08-26 21:40:16.596223207 +0530 diff --git a/glibc.spec b/glibc.spec index bb23d9e..08b1d17 100644 --- a/glibc.spec +++ b/glibc.spec @@ -1,6 +1,6 @@ %define glibcsrcdir glibc-2.17-c758a686 %define glibcversion 2.17 -%define glibcrelease 20%{?dist} +%define glibcrelease 21%{?dist} ### glibc.spec.in follows: %define run_glibc_tests 1 %define auxarches athlon alphaev6 @@ -135,6 +135,11 @@ Patch1012: %{name}-rh985342.patch Patch1013: %{name}-rh985625-CVE-2013-4788.patch # Add support for rtlddir distinct from slibdir. Patch1014: %{name}-rh950093.patch +# CVE-2014-5119 +Patch1015: %{name}-rh1133812-1.patch +# CVE-2014-0475 +Patch1016: %{name}-rh1133812-2.patch +Patch1017: %{name}-rh1133812-3.patch # # Patches submitted, but not yet approved upstream. @@ -462,6 +467,9 @@ package or when debugging this package. %patch1012 -p1 %patch1013 -p1 %patch1014 -p1 +%patch1015 -p1 +%patch1016 -p1 +%patch1017 -p1 # On powerpc32, hp timing is only available in power4/power6 # libs, not in base, so pre-power4 dynamic linker is incompatible @@ -1252,6 +1260,12 @@ rm -f *.filelist* %endif %changelog +* Wed Aug 27 2014 Carlos O'Donell - 2.17-21 +- Remove gconv transliteration loadable modules support (CVE-2014-5119, + #1133812). +- _nl_find_locale: Improve handling of crafted locale names (CVE-2014-0475, + #1133812). + * Fri Nov 8 2013 Carlos O'Donell - 2.17-20 - Depend on systemd instead of systemd-units (#1028430).