| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
vocally objected to this safety belt.
|
|
|
|
|
|
|
| |
technique) so that we don't wind up calling into an application's
version if the application defines them.
Inspired by: qpopper's interfering and buggy version of strlcpy
|
|
|
|
|
|
|
|
| |
currently cached data. It allows a number of nice things, like: removing
fallback code from single locale loading, remove memory leak when LC_CTYPE
data loaded again and again, efficient cache use, not only for
setlocale(locale1); setlocale(locale1), but for setlocale(locale1);
setlocale("C"); setlocale(locale1) too (i.e. data file loaded only once).
|
|
|
|
|
| |
Use ptr == NULL instead of !ptr in few places.
Move saverr declaration to global section.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
2) Move incomplete check for / in locale name from env section to
loadlocale(), add check for "." and ".." too.
It allows to check any argument, not env only.
3) Redesing LOAD_CATEGORY macro to eliminate code duplication.
4) Try harder in fallback code: if old locale can't be restored,
load "C" locale
5) White space formatting, long lines, etc.
|
|
|
|
|
| |
return(NULL) for upward compatibility with more LC_* categories may be
implemented in future.
|
|
|
|
|
|
| |
Replace strnpy + ='\0' with strlcpy
MFC after: 1 day
|
|
|
|
| |
I believe have made all of libc .c's as consistent as possible.
|
| |
|
|
|
|
| |
own
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The below text is quoted from the latest POSIX draft:
: The values of locale categories shall be determined by a precedence
: order; the first condition met below determines the value:
:
: 1. If the LC_ALL environment variable is defined and is not null,
: the value of LC_ALL shall be used.
: 2. If the LC_* environment variable (LC_COLLATE, LC_CTYPE, LC_MESSAGES,
: LC_MONETARY, LC_NUMERIC, LC_TIME) is defined and is not null, the
: value of the environment variable shall be used to initialize the
: category that corresponds to the environment variable.
: 3. If the LANG environment variable is defined and is not null, the
: value of the LANG environment variable shall be used.
: 4. If the LANG environment variable is not set or is set to the empty
: string, the implementation-defined default locale shall be used.
The conditions 1 and 2 were interchanged, i.e., LC_* were looked first,
then LC_ALL, then LANG (note that LC_ALL and LANG were essentially the
same, providing the default, with LC_ALL taking precedence over LANG).
Now, LC_ALL and LANG serve the different purposes. LC_ALL overrides
any LC_*, and LANG provides the default fallback.
Testcase:
/usr/bin/env LC_ALL=C LC_TIME=de_DE.ISO_8859-1 /bin/date
Should return date in the "C" locale format.
Inspired by: date(1) reference page in the Draft
|
|
|
|
|
|
|
| |
LC_MONETARY, LC_NUMERIC and LC_MESSAGES. Remove stub functions since they
don't need anymore.
Reviewed by: silence on -i18n
|
|
|
|
|
|
|
|
|
|
|
|
| |
be used to point to a bad locale file. This is only believed to be a
minor security risk - the only risk is if some program uses the result
of a localized string as a format specifier in a vulnerable function
like sprintf(). No such code is believed to exist in the FreeBSD base
system, although it is possible that badly written third party code
would do that.
Submitted by: imp
Approved by: ache
|
|
|
|
|
|
|
| |
boolean and it is LC_ALL that's special.
Someone submitted this to me a long time ago, but I can't find the
mail now.
|
| |
|
|
|
|
|
| |
PR: 14742
Submitted by: peter@wahoo.com.tw
|
| |
|
| |
|
|
|
|
| |
do not exist in NetBSD 1.3.
|
| |
|
| |
|
|
|
|
|
|
| |
whole setlocale.c module now.
Should go into 2.2
|
|
|
|
|
| |
. add idempotency #ifdef
. avoid sloppy common-style external declaration.
|
|
|
|
|
|
|
|
| |
Add range check for setrunelocale since it can be called
directly.
Remove _startup_setlocale compatibility function
Should go into 2.2
|
|
|
|
| |
Submitted by: Wojtek Pilorz <wpilorz@celebris.bdk.lublin.pl>
|
|
|
|
|
|
|
| |
Fix setrunelocale fail if called directly without prior setlocale
call
Should go in 2.2
|
|
|
|
|
| |
for debugging locale stuff, but was rarely if ever used...and of course
just bit a big chunk out of our collective hind-ends.
|
|
|
|
| |
to stop people "fixing" it by snprintf
|
|
|
|
|
|
|
|
| |
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.
Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.
|
|
|
|
|
|
| |
Since locale reading code not resistent against stack overflowing or
similar intruder attacks, don't allow PATH_LOCALE env variable action
for s-bit programs (non-standard locale path setting)
|
|
|
|
| |
Optimize/improve recently added locale restoration on failure
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
strdup() it to prevent unsetenv() or setenv() effects. Check its length to
not allow user to overflow internal locale buffer. Move PATH_LOCALE
handling code into one place.
POSIX: make better stub for LC_MONETARY & LC_NUMERIC, now it check
locale directory existance instead of refusing all non-C non-POSIX
locales. POSIX treats empty locale env variable as unset variable
while our old code treats it as "C" locale, fix it. Implement previous locale
restoring, if locale setting fails. Old code assumes success if some
of LC_ALL subset is successed even other fails, POSIX treats it as
failure with previous locale restoring, fix it.
Remove unneccessary length checking in currentlocale()
|
| |
|
|
|
|
|
| |
Remove big part of my startup_setlocale hack.
Add missing manpage links.
|
|
|
|
| |
Oh I also put in a couple of compile-time warnings for the crypt stuff.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
by me). This probably loses for multibyte characters, but I have no
way of telling. I'll let ache decide whether to add this support to
startup_setlocale. Note that for this to make any sense at all, the
symlinks in /usr/share/locale must go. (For the moment, this doesn't
make any difference since there are no locales supplied.)
Obtained from: Arthur David Olson <ado@elsie.nci.nih.gov>
|
|
|
|
| |
Submitted by: alex@elvisti.kiev.ua
|
|
|
|
|
| |
split modules to bring only neccessary functions,
eliminate sprintf, make reduced startup_locale version.
|
|
|