bug-autoconf
[Top][All Lists]
Advanced

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

[GNU Autoconf 2.69] "do" call in autoheader possibly broken under future


From: Kent Fredric
Subject: [GNU Autoconf 2.69] "do" call in autoheader possibly broken under future Perl 5.26 ( testsuite: 38 501 failed , test tools.at fails with "error: AC_CONFIG_HEADERS not found in file with funny ' $x & #! name .in" )
Date: Sat, 29 Apr 2017 10:43:41 +1200

Since Perl 5.25.11, Perl has omitted "." from its default library path.

This affects both "require" and "do", which autoheader uses.

Previously, people assumed (incorrectly) that:

        do "foo.pm"

Was *literally* equivalent to

        eval `cat foo.pm`

Unfortunately, due to a gross lack of clarity in the documentation, this
was only *effectively* the case due to @INC traversal where '.' ( CWD )
made it work.

The end result now is this statement in autoheader:

https://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=blob;f=bin/autoheader.in;hb=60460b91d0944a376063edd4ef09112a21ffa3d6#l186

 185 debug "$me: 'do'ing $tmp/traces.pl:\n" . `sed 's/^/| /' 
$quoted_tmp/traces.pl`;
 186 do "$tmp/traces.pl";
 187 warn "couldn't parse $tmp/traces.pl: $@" if $@;
 188 unless ($config_h)

Will habitually do the wrong thing, and emits a failure in tools.at as
follows:

--- /dev/null   2017-04-23 16:19:22.434000368 +0000
+++ 
/var/tmp/portage/sys-devel/autoconf-2.69-r3/work/autoconf-2.69/tests/testsuite.dir/at-groups/38/stderr
      2017-04-28 21:00:36.523807621 +0000
@@ -0,0 +1,2 @@
+do " tmp dir with  funny ' $x & #! name /ahV118Zr/traces.pl" failed, '.' is no 
longer in @INC; did you mean do "./ tmp dir with  funny ' $x & #! name 
/ahV118Zr/traces.pl"? at 
/var/tmp/portage/sys-devel/autoconf-2.69-r3/work/autoconf-2.69/bin/autoheader 
line 186.
+autoheader: error: AC_CONFIG_HEADERS not found in  file with  funny ' $x & #! 
name .in
./tools.at:1310: exit code was 1, expected 0
38. tools.at:1278: 38. autotools and whitespace in file names (tools.at:1278): 
FAILED (tools.at:1310)

#                             -*- compilation -*-


The solution may be simple:

Both "do" and "require" can have @INC traversal subverted by passing
either an explicitly relative path ( that is, with a leading './' ), or
a computed absolute path, as these are special cased in the underling
mechanic. Do exercise extreme caution here, as not to blindly reinsert
'.' into @INC as that has possible security implications.

In the event the consequences of this is limited only to testing,
affected end users can temporarily restore the traditional behaviour of
an implicit ".", by setting PERL_USE_UNSAFE_INC=1 in their environment,
and this value is used in a few significant CPAN toolchain pieces to
mitigate the consequences of this change there.

However, if as I suspect the problem is greater than just this test
failing, and the real failure exhibits real problems at runtime, this
work around will need to be applied everywhere they expect autoheader
to be run, until a real fix is applied.

Attached is the full build output and test logs from Gentoo's (patched)
version of 2.69, which already has some fixes applied for perl 5.26.




Attachment: testsuite.log
Description: Text Data

Attachment: autoconf-2.69-r3:20170428-205946.log
Description: Text Data

Attachment: pgpUR7M7xyf3U.pgp
Description: OpenPGP digital signature


reply via email to

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