File: 06taint.t

package info (click to toggle)
libsys-utmp-perl 1.6-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 116 kB
  • ctags: 10
  • sloc: perl: 237; makefile: 40
file content (30 lines) | stat: -rwxr-xr-x 487 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/perl -T

use strict;
use warnings;

use Sys::Utmp;
use Test::More; 

eval "use Scalar::Util qw(tainted)";

#plan skip_all => "Tainting check skipped";

if ( $@ )
{
   plan skip_all => "Need Scalar::Util to test tainting";
}
else
{
   plan tests => 2;
}

my $utmp = Sys::Utmp->new();
 
my $utent =  $utmp->getutent();

SKIP: {
	skip "no utmp entries", 2 if ! $utent;
	ok(tainted($utent->ut_user()),"ut_user is tainted");
	ok(tainted($utent->ut_host()),"ut_host is tainted");
}