• Home
  • History
  • Annotate
  • only in this directory
NameDateSize

..01-Apr-201321

catopen.cH A D20-Aug-20054.9 KiB

READMEH A D20-Aug-20051.3 KiB

README

1In the good old days, with libc 4.*.*,
2if NLSPATH was set to "/usr/lib/locale/%N/%L"
3and LANG to "fr", then catopen("man",0) would open /usr/lib/locale/man/fr.
4
5These days, with libc 5.0.9, catopen will fail because it does a call
6to setlocale, and if no locale has been setup, the C locale is assumed,
7independent of the LANG setting.
8
9In order to preserve the possibility to say "LANG=de man fstab"
10for systems where no locale has been set up, I enclose here
11the original version of catopen.
12
13Concerning correctness: as far as I know POSIX does not specify
14catopen(), and X/Open specifies catopen() without mentioning any
15relation to locale - indeed, catopen() predates locale.
16So, I think catopen() in libc 5.0.9 is broken.
17
18---
19
20Time goes on, and I just looked at glibc-2.0.5.
21Its catgets() contains (at least) two bugs, and will dump core.
22One is fixed in RedHat's glibc-2.0.5c-10; I have submitted a fix
23for the other.  With a fixed catgets() things will work correctly.
24However, glibc does a secure_getenv("NLSPATH"), which means that
25the setting of NLSPATH is not taken into account for programs
26that are sgid or suid.  Thus, if you make man suid or sgid, and
27want to use message catalogues, you have to install them in the
28default place - on my system that is /usr/share/locale/%L/man
29where %L is $LANG.
30