The first bug is in the "date" program. To reproduce:

LC_ALL=C TZ=GMT date -d '2004-01-01 10:00 +0100'

Expected output: Thu Jan  1 09:00:00 GMT 2004
LFS produces: Thu Jan 1 09:00:18 GMT 2004 where 18 is the number of seconds in the current date. Fix: http://cvs.fedora.redhat.com/viewcvs/*checkout*/devel/coreutils/coreutils-dateseconds.patch?rev=1.1

The second bug is in the "who" program when it is called in non-C locale with "-Hu" options. The problem is that in some locales (including non-wide-character ones, e.g. ru_RU.KOI8-R) the translation of the string "IDLE" overflows the buffer in print_line(). This manifests itself as a cut end of the string, or as a detected buffer overflow if some buffer overflow detection is in use.

RedHat "fixed" that by defining IDLESTR_LEN to 10 instead of 6 in src/who.c, but this length is still insufficient for ru_RU.UTF-8 (the required length is 20 in that case). However, this also causes mis-aligned output, thus I think that it is better to remove all translations from the "who" program, by adding the following lines after all #include directives in src/who.c:

#undef _
#define _(x) x

Or, remove only translations of dangerous things, by removal of all undescores in print_heading().

--
Alexander E. Patrakov
--
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to