argunemt and with a string containing many slashes for the second argument.
This bug may cause setlocale() to destroy static datas.
If a setuid program calls this function as 'setlocale(LC_ALL, "");',
this might be vulnerable, although there are few programs having such
vulnerability. This bug probably affects every versions of NetBSD,
including 1.4, 1.5 and 1.6.
XXX: This part of setlocale is unseemly, thus we had better rewrite it in
the future.
have magic number check in locale modules.
rename: lib/libc/locale/setlocale_sb.c -> setlocale1.c
NOTE: this commit does not enable multibyte locale support, yet.
ld.elf_so with citrus locale, it bombs.
XXX this is shortterm workaround. if you are willing to test citrus locale,
use RUNE=yes in libc/locale/Makefile.inc.
for LC_ALL, return success if at least on of categories was loaded
successfully, error if no category was loaded; in the latter case, we don't
need to back off locale changes, since none happened
shot-term TODO:
- enable multibyte locales. this includes loadable locale modules
(#ifdef DLRUNE).
- populate LC_CTYPE definition files.
- other functions such as iconv()
- make libc functions more friendly with multibyte.
- multilingualize other LC_xx
- torture tests
XXX don't forget to "make depend" when you rebuild libc, multibyte.c is
moved from lib/libc/stdlib to lib/libc/locale.
- MB_LEN_MAX is increased to 32.
- To ensure binary compatibility for old executables
under multibyte locale, versioned setlocale is added.
- __mb_len_cur definision is added in setlocale.c
and enable it in stdlib.h .
It is also important for multibyte locale stuffs,
but I just forgot.
loadlocale() fails - since only LC_CTYPE is implemented and all
other categories return error, code never got to actually
load the ctype locales, as first category tried was LC_COLLATE
and it always failed