[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [patches] [PATCH] localedef cross endianess problem
- To: Maxim Kuvyrkov <maxim@xxxxxxxxxxxxxxxx>
- Subject: Re: [patches] [PATCH] localedef cross endianess problem
- From: "Joseph S. Myers" <joseph@xxxxxxxxxxxxxxxx>
- Date: Mon, 19 Jan 2009 17:33:09 +0000 (UTC)
On Sun, 18 Jan 2009, Maxim Kuvyrkov wrote:
> The place where the data is written is locfile.c:write_locale_data(). At the
> start of this function file header ('magic' and 'nstrings' fields) and offsets
> within the file (strindex[]) are converted to target endianess. Hence anytime
> these data is accessed on host it should be converted back.
>
> There are 3 places where the data is being accessed by host:
> locarchive.c:add_locale_to_archive(), locale.c:print_LC_IDENTIFICATION() and
> locale.c:print_LC_CTYPE(). In each of these functions accesses to
> filedata->magic, filedata->nstrings and filedata->strindex[i] fields should be
> wrapped into maybe_swap_uint32().
>
> Marc, your patch handles the place in locarchive.c; the attached patch handles
> the rest.
>
> Joseph, does the analysis and patch look OK to you?
It seems sound to me. The key test would be creating locales, with a
locale archive, both natively with one endianness and cross from another
endianness, and verifying that the resulting archive is identical in both
cases.
--
Joseph S. Myers
joseph@xxxxxxxxxxxxxxxx