summary refs log tree commit diff
path: root/locale
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-08-21 20:58:00 +0000
committerUlrich Drepper <drepper@redhat.com>2000-08-21 20:58:00 +0000
commit63336471f0e705e7259c9ecb0f9b473890ff5ffc (patch)
treeb23b64b55ace8424e3898f8f8278a79527cd22c0 /locale
parentce19d4174684e225e3c70ceca4557af6dc651317 (diff)
downloadglibc-63336471f0e705e7259c9ecb0f9b473890ff5ffc.tar.gz
glibc-63336471f0e705e7259c9ecb0f9b473890ff5ffc.tar.xz
glibc-63336471f0e705e7259c9ecb0f9b473890ff5ffc.zip
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.
Diffstat (limited to 'locale')
-rw-r--r--locale/findlocale.c13
1 files changed, 6 insertions, 7 deletions
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)
     {