Insecure dependency in chdir while running with -T switch when running in docker container

240 Views Asked by At

I am using module-starter to create a CPAN module. It automatically creates some tests

$ ls t/
00-load.t  manifest.t  pod-coverage.t  pod.t

with shebang #!perl -T so running the tests under taint mode. It works fine on my laptop with Ubuntu 20.04 (no test failures), but when I run the same tests in Docker container with Ubuntu 20.04 and also use the module Alien::GSL I get error:

$ perl -T -I./lib t/00-load.t 
not ok 1 - use My::Module;
#   Failed test 'use My::Module;'
#   at t/00-load.t line 10.
#     Tried to use 'My::Module'.
#     Error:  Insecure dependency in chdir while running with -T switch at /home/hakond/perl5/perlbrew/perls/perl-5.32.0/lib/5.32.0/File/Find.pm line 375.
# BEGIN failed--compilation aborted at lib/My/Module.pm line 7.
# Compilation failed in require at t/00-load.t line 10.
# BEGIN failed--compilation aborted at t/00-load.t line 10.

The error can be produced more simply (in the Docker container) with:

$ perl -T -MAlien::GSL -e1
Insecure dependency in chdir while running with -T switch at /home/hakond/perl5/perlbrew/perls/perl-5.32.0/lib/5.32.0/File/Find.pm line 375.
BEGIN failed--compilation aborted.

the above commands runs fine (no errors) on my laptop.

Any ideas what is going on?

1

There are 1 best solutions below

0
On

The difference between the behavior in the docker container and the laptop seems to be related to libgsl-dev being installed on my laptop.

According to this issue the taint mode should not be enabled by default anyway.