Plan 9 from Bell Labs’s /usr/web/sources/contrib/gabidiaz/root/sys/src/cmd/perl/ext/Cwd/t/taint.t

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!./perl -Tw
# Testing Cwd under taint mode.

BEGIN {
    chdir 't' if -d 't';
    @INC = '../lib';
}

use Cwd;
use Test::More tests => 6;
use Scalar::Util qw/tainted/;

my $cwd;
eval { $cwd = getcwd; };
is( $@, '',		'getcwd() does not explode under taint mode' );
ok( tainted($cwd),	"its return value is tainted" );

eval { $cwd = cwd; };
is( $@, '',		'cwd() does not explode under taint mode' );
ok( tainted($cwd),	"its return value is tainted" );

eval { $cwd = fastcwd; };
is( $@, '',		'fastcwd() does not explode under taint mode' );
ok( tainted($cwd),	"its return value is tainted" );

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].