[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Worth mentioning that Gnome needs a fix for newer Autoconf?

From: Ralf Wildenhues
Subject: Re: Worth mentioning that Gnome needs a fix for newer Autoconf?
Date: Mon, 5 Jun 2006 08:13:57 +0200
User-agent: Mutt/1.5.11+cvs20060403

Hello Paul, Ben,

* Paul Eggert wrote on Sun, Jun 04, 2006 at 11:05:31PM CEST:
> Ben Pfaff <address@hidden> 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.


> 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]