lib/perl5db/t/rt-61222 Tests for the Perl debugger
lib/perl5db/t/rt-66110 Tests for the Perl debugger
lib/perl5db/t/symbol-table-bug Tests for the Perl debugger
+lib/perl5db/t/taint Tests for the Perl debugger
lib/PerlIO.pm PerlIO support module
lib/Pod/Functions.pm used by pod/splitpod
lib/Pod/Html.pm Convert POD data to HTML
}
}
-plan(8);
+plan(9);
sub rc {
open RC, ">", ".perldb" or die $!;
like($output, "All tests successful.", "[perl #66110]");
}
+# taint tests
+
+{
+ local $ENV{PERLDB_OPTS} = "ReadLine=0 NonStop=1";
+ my $output = runperl(switches => [ '-d', '-T' ], stderr => 1,
+ progfile => '../lib/perl5db/t/taint');
+ is($output, '[$^X][done]', "taint");
+}
+
# clean up.
--- /dev/null
+#!/usr/bin/perl -T
+#
+# This code is used by lib/perl5db.t !!!
+#
+use Scalar::Util qw(tainted);
+
+# [perl #76872] don't taint $DB::sub
+
+sub f {}
+
+BEGIN {
+ print "[\$^X]" if tainted($^X);
+ ($^X || 1) && f(); # maybe taint $DB::sub;
+ print "[\$DB::sub]" if tainted($DB::sub);
+}
+print "[done]";
+
{
dVAR;
SV * const dbsv = GvSVn(PL_DBsub);
+ const bool save_taint = PL_tainted;
+
/* We do not care about using sv to call CV;
* it's for informational purposes only.
*/
PERL_ARGS_ASSERT_GET_DB_SUB;
+ PL_tainted = FALSE;
save_item(dbsv);
if (!PERLDB_SUB_NN) {
GV * const gv = CvGV(cv);
(void)SvIOK_on(dbsv);
SvIV_set(dbsv, PTR2IV(cv)); /* Do it the quickest way */
}
+ TAINT_IF(save_taint);
}
int