From: Ulrich Drepper Date: Wed, 20 May 1998 12:10:21 +0000 (+0000) Subject: (_nl_find_locale): Use _nl_find_locale to get language part it drop X-Git-Tag: cvs/sparc-980522-merge~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97373eb4d3988e5591d81dd2a16a109ab50b0dc1;p=thirdparty%2Fglibc.git (_nl_find_locale): Use _nl_find_locale to get language part it drop the value is path element is contained. --- diff --git a/locale/findlocale.c b/locale/findlocale.c index d73ba4a3956..4e8460ee4af 100644 --- a/locale/findlocale.c +++ b/locale/findlocale.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1998 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. @@ -20,6 +20,7 @@ #include #include #include +#include #include "localeinfo.h" @@ -61,7 +62,11 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len, const char *revision; struct loaded_l10nfile *locale_file; - if ((*name)[0] == '\0') + if ((*name)[0] == '\0' + /* In SUID binaries we must not allow people to access files + outside the dedicated locale directories. */ + || (__libc_enable_secure + && memchr (*name, '/', _nl_find_language (*name) - *name) != NULL)) { /* The user decides which locale to use by setting environment variables. */