This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/2] ldd: Don't use Bash-only $"msgid" quoting


On Thu, Nov 22, 2012 at 10:42:12PM -0500, P. J. McDermott wrote:
> On non-Bash shells, ldd prints translatable strings in English
> (regardless of the environment's locale) and prefixed with dollar signs,
> e.g.:
> 
>     $ export LC_ALL=es_ES.UTF-8
>     $ /bin/dash /usr/bin/ldd --invalid
>     ldd: $unrecognized option `--invalid'
>     $Try `ldd --help' for more information.
> 
> This patch makes ldd use the more portable (and secure) gettext utility
> and eval_gettext function.
> 
> 2012-11-22  P. J. McDermott  <pjm@nac.net>
> 
> 	* elf/ldd.bash.in: Use gettext utility and eval_gettext function instead
> 	of insecure and unportable Bash $"msgid" quoting.

Note that bash $"msgid" syntax works without gettext being installed,
so bash-based ldd, unlike your edition, can work without gettext.
That is, your patch achieves portability by penalizing some installs with
artificial requirements.  Also, there are no runtime checks for gettext
availability, so there is a chance to lose messages.


-- 
ldv

Attachment: pgp00000.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]