Bug#370282: Worth mentioning that Gnome needs a fix for newer Autoconf?

Ralf Wildenhues Ralf.Wildenhues at gmx.de
Mon Jun 5 06:13:57 UTC 2006


Hello Paul, Ben,

* Paul Eggert wrote on Sun, Jun 04, 2006 at 11:05:31PM CEST:
> Ben Pfaff <blp at cs.stanford.edu> writes:
> 
> >  The problem is in AM_GLIB_DEFINE_LOCALEDIR from
> >  m4macros/glib-gettext.m4 which hardcodes a double shell expansion:
> >    localedir=`eval echo "${datadir}/locale"`

> First, Autoconf is supposed to warn about the suspicious usage of
> datadir without defining datarootdir.  Did the warning not work for
> you?  If so, can you show us how to reproduce the problem easily?

The warnings that have been put into place cannot work for these cases.
Even if we tried to warn about strings containing `${datarootdir}' in
config headers (which we don't, and can't easily do without risking
false positives), even then, we would not have caught this issue.
I don't see any reasonable way we can warn about this case.  At least
it usually causes non-silent breakage, thus is usually found quickly.

> Second, that promiscuous 'eval' can lead to trouble.  First, it
> assumes that exactly one level of indirection will be right, which is
> not portable to future versions of Autoconf.  Second, if localedir
> contains special characters they can cause arbitrary shell code to be
> executed.

Yes.

> Something like this code (which I haven't tested) would be safer:

Please don't recommend such code.  We have a FAQ entry (Ben already
quoted it) which shows how to deal with directory variables in a future-
proof way.  Let's just recommend that.

> for i in . . . . . . . . . . . . X; do
>   test $i = X && AC_MSG_ERROR([too many levels of indirection in localedir])
>   case $localedir in
>     *'"'* | *'`'* | *'\'* | *'$('*)

I'm think this will break with some old shell.  I'd use backslash-
escaping only within case patterns, because of the comment to some
respective code we eliminated from Autoconf not so long ago:
      *\"* | *\`* | *\\* | *\$\(* )

(I meant to dig out the actual errors and document them at some
point...)

Cheers,
Ralf





More information about the Pkg-gnome-maintainers mailing list