Name

SafeTrap — specify operation codes to trap in Safe.pm compartments

SYNOPSIS

opcode...

DESCRIPTION

The directive defines the opcodes that will be trapped in the Safe compartments, for use in embedded Perl and conditional operations.

For a complete discussion and the opcodes list, see Opcode(3perl) manual page.

DIRECTIVE TYPE AND DEFAULT VALUE

Global directive

EXAMPLES

Example: Disabling rand function

SafeTrap rand

NOTES

Please see the safe glossary entry for the introduction and guidelines to programming under Safe.pm restrictions.

The SafeUntrap directive runs after SafeTrap and takes precedence. Make sure the opcodes you want to trap are not later untrapped with SafeUntrap.

AVAILABILITY

SafeTrap is available in Interchange versions:

4.6.0-5.9.0 (git-head)

SOURCE

Interchange 5.9.0:

Source: lib/Vend/Config.pm
Line 494

['SafeTrap',         'array',            ':base_io'],

Source: lib/Vend/Config.pm
Line 3763 (context shows lines 3763-3783)

sub parse_array {
my($item,$settings) = @_;
return '' unless $settings;
my(@setting) = grep /\S/, split /[\s,]+/, $settings;

my $c;

if(defined $C) {
  $c = $C->{$item} || [];
}
else {
  no strict 'refs';
  $c = ${"Global::$item"} || [];
}

for (@setting) {
  check_legal($item, $_);
  push @{$c}, $_;
}
$c;
}

AUTHORS

Interchange Development Group

SEE ALSO

SafeUntrap(7ic)

DocBook! Interchange!