Discussion:
[rt.cpan.org #65703] Build Problem - Inline::C fails at t/08taint.t
Brian Fraser via RT
2014-02-23 18:10:56 UTC
Permalink
Sun Feb 23 13:10:55 2014: Request 65703 was acted upon.
Transaction: Correspondence added by Hugmeir
Queue: Inline
Subject: Build Problem - Inline::C fails at t/08taint.t
Broken in: (no value)
Severity: (no value)
Owner: Nobody
Requestors: alexander.haeckel-S0/***@public.gmane.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=65703 >
The problem here as I see it ist the use of
(stat("/usr/bin"))[2] & 0022
instead of
(stat("/usr/bin"))[2] & 0002
, because you must be authorized to write into
the first case, but needn't be in the second.
If you exclude 0020 you could exclude 0200 for
the same reasons.
To me it would seem more consistent to use the -w, -W operators
to check for every directory in the path if it
is writable at all. Then you can omit the
join ':', grep {not /^\./ and -d $_ and not -w $_ || -W $_
} split /:/, $ENV{PATH};
This issue just bit me when smoking CPAN on Android. Unfortunately, the above solution doesn't work for me.

tl;dr: Skipping the tests when $^O eq 'android' would probably be for the best, if that filter is going to stay.

Android's an interesting case. It's basically a linux system that doesn't provide any toolchain whatsoever, so you either have to install one yourself (and to do that, you need to root your phone and probably create/mount an ext3/4 partition in your sdcard) or have an app install it for you. Either way, the toolchain ends up in a non-standard location with non-standard permissions, and to use it you need to tweak with it's permissions and/or be root.

There's probably no ideal solution here, but either way my suggestion is to have the module skip t/08taint.t under Android, and then to have env_untaint actually check if an entry is already untainted (with Scalar::Util::tainted in perl>=5.8, and whatever the eval invocation in older perls is); if it is, trust it as-is, no need to filter anything. That way, if someone wants to use Inline on Android under taint, they can do it by manually untainting $ENV{PATH}, which they should've been doing on the first place :)
s***@public.gmane.org
2014-03-05 13:37:43 UTC
Permalink
-----Original Message-----
From: Brian Fraser via RT
Post by Brian Fraser via RT
To me it would seem more consistent to use the -w, -W operators
to check for every directory in the path if it
is writable at all. Then you can omit the
join ':', grep {not /^\./ and -d $_ and not -w $_ || -W $_
} split /:/, $ENV{PATH};
This issue just bit me when smoking CPAN on Android. Unfortunately, the
above solution doesn't work for me.
tl;dr: Skipping the tests when $^O eq 'android' would probably be for the
best, if that filter is going to stay.
I've just uploaded Inline-0.53_01 to CPAN.
It includes Alexander's recommended change to env_untaint() and also has
08taint.t skip the tests for Android.

Brian/Alexander - if you want any additional changes to env_untaint (or
anything else, for that matter) just send me the patch and we should be able
to get it incorporated into the next stable release (0.54).

Thanks guys.

Cheers,
Rob
sisyphus1-sFbbPxZDHXw0n/F98K4Iww@public.gmane.org via RT
2014-03-05 13:39:02 UTC
Permalink
Wed Mar 05 08:39:01 2014: Request 65703 was acted upon.
Transaction: Correspondence added by sisyphus1-sFbbPxZDHXw0n/***@public.gmane.org
Queue: Inline
Subject: Re: [rt.cpan.org #65703] Build Problem - Inline::C fails at t/08taint.t
Broken in: (no value)
Severity: (no value)
Owner: Nobody
Requestors: alexander.haeckel-S0/***@public.gmane.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=65703 >




-----Original Message-----
From: Brian Fraser via RT
Post by Brian Fraser via RT
To me it would seem more consistent to use the -w, -W operators
to check for every directory in the path if it
is writable at all. Then you can omit the
join ':', grep {not /^\./ and -d $_ and not -w $_ || -W $_
} split /:/, $ENV{PATH};
This issue just bit me when smoking CPAN on Android. Unfortunately, the
above solution doesn't work for me.
tl;dr: Skipping the tests when $^O eq 'android' would probably be for the
best, if that filter is going to stay.
I've just uploaded Inline-0.53_01 to CPAN.
It includes Alexander's recommended change to env_untaint() and also has
08taint.t skip the tests for Android.

Brian/Alexander - if you want any additional changes to env_untaint (or
anything else, for that matter) just send me the patch and we should be able
to get it incorporated into the next stable release (0.54).

Thanks guys.

Cheers,
Rob
Graham Ollis via RT
2014-04-30 09:11:58 UTC
Permalink
Wed Apr 30 05:11:58 2014: Request 65703 was acted upon.
Transaction: Correspondence added by PLICEASE
Queue: Inline
Subject: Build Problem - Inline::C fails at t/08taint.t
Broken in: (no value)
Severity: (no value)
Owner: Nobody
Requestors: alexander.haeckel-S0/***@public.gmane.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=65703 >


I got this (I believe related) error trying to install Inline (+Inline::C)

t/08taint.t ............. 1/10 Running Mkbootstrap for _08taint_1_p_0965 ()
chmod 644 _08taint_1_p_0965.bs
/home/ollisg/perl5/perlbrew/perls/perl-5.18.2c/bin/perl /home/ollisg/.perlbrew/libs/perl-***@dev/lib/perl5/ExtUtils/xsubpp -typemap "/home/ollisg/perl5/perlbrew/perls/perl-5.18.2c/lib/5.18.2/ExtUtils/typemap" _08taint_1_p_0965.xs > _08taint_1_p_0965.xsc && mv _08taint_1_p_0965.xsc _08taint_1_p_0965.c
clang -c -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -DVERSION=\"0.00\" -DXS_VERSION=\"0.00\" -fPIC "-I/home/ollisg/perl5/perlbrew/perls/perl-5.18.2c/lib/5.18.2/x86_64-linux/CORE" _08taint_1_p_0965.c
/bin/sh: 1: clang: not found
make: *** [_08taint_1_p_0965.o] Error 127

A problem was encountered while attempting to compile and install your Inline
C code. The command that failed was:
make > out.make 2>&1

The build directory was:
/home/ollisg/.cpanm/work/1398847813.20092/Inline-0.55/C/_Inline_test/build/_08taint_1_p_0965

To debug the problem, cd to the build directory, and inspect the output files.

at ./t/08taint_1.p line 7.
...propagated at /home/ollisg/.perlbrew/libs/perl-***@dev/lib/perl5/Inline/C.pm line 797.
BEGIN failed--compilation aborted at ./t/08taint_1.p line 7.
Compilation failed in require at t/08taint.t line 45.
# Looks like you planned 10 tests but ran 1.
# Looks like your test exited with 2 just after 1.
t/08taint.t ............. Dubious, test returned 2 (wstat 512, 0x200)
Failed 9/10 subtests

I've installed clang into my home directory because the version that comes with my OS is very old. I feel like this configuration should be supported, but perhaps not? As a work around I chmod -R -x the appropriate directorys in my clang install and the then install worked.
Chris Marshall via RT
2014-05-06 13:14:25 UTC
Permalink
Tue May 06 09:14:24 2014: Request 65703 was acted upon.
Transaction: Correspondence added by CHM
Queue: Inline
Subject: Build Problem - Inline::C fails at t/08taint.t
Broken in: (no value)
Severity: (no value)
Owner: Nobody
Requestors: alexander.haeckel-S0/***@public.gmane.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=65703 >


I hit the same error with my cygwin64. In my specific
case, the issue is that I have all of the added perl
modules installed into a separate non-system location
and PERL5LIB is set so that works.

With -T PERL5LIB is not consulted. A look at the pod
for taint in perlrun suggests to add

use lib '/my/perl5/lib/dir';

When I did that, it all works. I'm not sure if this is related
to the other failures but it is definitely the problem for
a non-system perl install with INSTALL_BASE and the
use of PERL5LIB.

--Chris
Post by Graham Ollis via RT
I got this (I believe related) error trying to install Inline
(+Inline::C)
t/08taint.t ............. 1/10 Running Mkbootstrap for
_08taint_1_p_0965 ()
chmod 644 _08taint_1_p_0965.bs
/home/ollisg/perl5/perlbrew/perls/perl-5.18.2c/bin/perl
-typemap "/home/ollisg/perl5/perlbrew/perls/perl-
5.18.2c/lib/5.18.2/ExtUtils/typemap" _08taint_1_p_0965.xs >
_08taint_1_p_0965.xsc && mv _08taint_1_p_0965.xsc _08taint_1_p_0965.c
clang -c -fno-strict-aliasing -pipe -fstack-protector
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2
-DVERSION=\"0.00\" -DXS_VERSION=\"0.00\" -fPIC "-
I/home/ollisg/perl5/perlbrew/perls/perl-5.18.2c/lib/5.18.2/x86_64-
linux/CORE" _08taint_1_p_0965.c
/bin/sh: 1: clang: not found
make: *** [_08taint_1_p_0965.o] Error 127
A problem was encountered while attempting to compile and install your
Inline
make > out.make 2>&1
/home/ollisg/.cpanm/work/1398847813.20092/Inline-
0.55/C/_Inline_test/build/_08taint_1_p_0965
To debug the problem, cd to the build directory, and inspect the
output files.
at ./t/08taint_1.p line 7.
...propagated at /home/ollisg/.perlbrew/libs/perl-
BEGIN failed--compilation aborted at ./t/08taint_1.p line 7.
Compilation failed in require at t/08taint.t line 45.
# Looks like you planned 10 tests but ran 1.
# Looks like your test exited with 2 just after 1.
t/08taint.t ............. Dubious, test returned 2 (wstat 512, 0x200)
Failed 9/10 subtests
I've installed clang into my home directory because the version that
comes with my OS is very old. I feel like this configuration should
be supported, but perhaps not? As a work around I chmod -R -x the
appropriate directorys in my clang install and the then install
worked.
Chris Marshall via RT
2014-05-06 13:15:50 UTC
Permalink
Tue May 06 09:15:50 2014: Request 65703 was acted upon.
Transaction: Correspondence added by CHM
Queue: Inline
Subject: Build Problem - Inline::C fails at t/08taint.t
Broken in: (no value)
Severity: (no value)
Owner: Nobody
Requestors: alexander.haeckel-S0/***@public.gmane.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=65703 >


My use lib line was added just after all the
BEGIN{} blocks in t/08taint.t...
Post by Chris Marshall via RT
I hit the same error with my cygwin64. In my specific
case, the issue is that I have all of the added perl
modules installed into a separate non-system location
and PERL5LIB is set so that works.
With -T PERL5LIB is not consulted. A look at the pod
for taint in perlrun suggests to add
use lib '/my/perl5/lib/dir';
When I did that, it all works. I'm not sure if this is related
to the other failures but it is definitely the problem for
a non-system perl install with INSTALL_BASE and the
use of PERL5LIB.
--Chris
Ed J via RT
2014-06-12 08:34:16 UTC
Permalink
Thu Jun 12 04:34:15 2014: Request 65703 was acted upon.
Transaction: Correspondence added by ETJ
Queue: Inline
Subject: Build Problem - Inline::C fails at t/08taint.t
Broken in: (no value)
Severity: (no value)
Owner: Nobody
Requestors: alexander.haeckel-S0/***@public.gmane.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=65703 >


I'd be very interested to know whether the change proposed in https://github.com/mohawk2/inline-pm/commit/f9242a2e92244d99a2ce051c9ae523913eb47fc4 fixes this issue.
Ed J via RT
2014-06-12 08:34:16 UTC
Permalink
<URL: https://rt.cpan.org/Ticket/Display.html?id=65703 >

I'd be very interested to know whether the change proposed in https://github.com/mohawk2/inline-pm/commit/f9242a2e92244d99a2ce051c9ae523913eb47fc4 fixes this issue.
Sisyphus via RT
2014-06-24 08:17:19 UTC
Permalink
Tue Jun 24 04:17:18 2014: Request 65703 was acted upon.
Transaction: Correspondence added by SISYPHUS
Queue: Inline
Subject: Build Problem - Inline::C fails at t/08taint.t
Broken in: (no value)
Severity: (no value)
Owner: Nobody
Requestors: alexander.haeckel-S0/***@public.gmane.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=65703 >



Superseded by #96291 (t/08taint.t fails on perl 5.20.0)

Loading...