From 63336471f0e705e7259c9ecb0f9b473890ff5ffc Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 21 Aug 2000 20:58:00 +0000 Subject: Update. * sysdeps/i370/Implies: Removed. * sysdeps/mvs/Implies: Removed. * catgets/catgets.c (catopen): Filter out env_var values with / if necessary. * locale/findlocale.c (_nl_find_locale): Move test for unusable locale name after all getenvs. --- ChangeLog | 9 +++++++++ catgets/catgets.c | 3 ++- locale/findlocale.c | 13 ++++++------- sysdeps/i370/Implies | 1 - sysdeps/mvs/Implies | 1 - 5 files changed, 17 insertions(+), 10 deletions(-) delete mode 100644 sysdeps/i370/Implies delete mode 100644 sysdeps/mvs/Implies diff --git a/ChangeLog b/ChangeLog index 9db8282650..3d693fdf26 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2000-08-21 Ulrich Drepper + * sysdeps/i370/Implies: Removed. + * sysdeps/mvs/Implies: Removed. + + * catgets/catgets.c (catopen): Filter out env_var values with / if + necessary. + + * locale/findlocale.c (_nl_find_locale): Move test for unusable + locale name after all getenvs. + * configure.in: Allow sed versions like 3.02.8. Patch by Rodrigo Barbosa . diff --git a/catgets/catgets.c b/catgets/catgets.c index 86ff0ff831..cad515d81a 100644 --- a/catgets/catgets.c +++ b/catgets/catgets.c @@ -50,7 +50,8 @@ catopen (const char *cat_name, int flag) /* Use the LANG environment variable. */ env_var = getenv ("LANG"); - if (env_var == NULL) + if (env_var == NULL || *env_var == '\0' + || (__libc_enable_secure && strchr (env_var, '/') != NULL)) env_var = "C"; env_var_len = strlen (env_var) + 1; diff --git a/locale/findlocale.c b/locale/findlocale.c index 7c77dd8e5e..275f7fc72e 100644 --- a/locale/findlocale.c +++ b/locale/findlocale.c @@ -54,11 +54,7 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len, const char *revision; struct loaded_l10nfile *locale_file; - if ((*name)[0] == '\0' - /* In SUID binaries we must not allow people to access files - outside the dedicated locale directories. */ - || (__builtin_expect (__libc_enable_secure, 0) - && memchr (*name, '/', _nl_find_language (*name) - *name) != NULL)) + if ((*name)[0] == '\0') { /* The user decides which locale to use by setting environment variables. */ @@ -67,10 +63,13 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len, *name = getenv (_nl_category_names[category]); if (*name == NULL || (*name)[0] == '\0') *name = getenv ("LANG"); - if (*name == NULL || (*name)[0] == '\0') - *name = (char *) _nl_C_name; } + if (*name == NULL || (*name)[0] == '\0' + || (__builtin_expect (__libc_enable_secure, 0) + && memchr (*name, '/', _nl_find_language (*name) - *name) != NULL)) + *name = (char *) _nl_C_name; + if (__builtin_expect (strcmp (*name, _nl_C_name), 1) == 0 || __builtin_expect (strcmp (*name, _nl_POSIX_name), 1) == 0) { diff --git a/sysdeps/i370/Implies b/sysdeps/i370/Implies deleted file mode 100644 index 39a34c5f57..0000000000 --- a/sysdeps/i370/Implies +++ /dev/null @@ -1 +0,0 @@ -wordsize-32 diff --git a/sysdeps/mvs/Implies b/sysdeps/mvs/Implies deleted file mode 100644 index b3188f7428..0000000000 --- a/sysdeps/mvs/Implies +++ /dev/null @@ -1 +0,0 @@ -posix -- cgit v1.2.3