Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 01330ec25d
Fetching contributors…

Cannot retrieve contributors at this time

61 lines (46 sloc) 1.663 kB
__NAME__ purpose
specify operation codes to untrap in Safe.pm compartments
__END__
__NAME__ synopsis
<arg choice='plain' rep='repeat'><replaceable>opcode</replaceable></arg>
__END__
__NAME__ description
The directive defines the opcodes that will be untrapped in the
<classname>Safe</classname> compartments, for use in
embedded &PERL; and conditional operations.
Define it as blank to prevent any operators but the default restrictive ones.
</para><para>
For a complete discussion and the complete list of opcodes, see
<citerefentry><refentrytitle>Opcode</refentrytitle>
<manvolnum>3perl</manvolnum></citerefentry> manual page.
__END__
__NAME__ example: Disabling all but most restrictive opcodes
<programlisting>
SafeUntrap
</programlisting>
__END__
__NAME__ example: Allowing -s function to determine file size
The following code fails to work with the default SafeUntrap setting.
<programlisting>
[set upload_repository]upload/[/set]
[calcn]-s $Scratch->{upload_repository};[/calcn]
</programlisting>
Adding <literal>ftsize</literal> to SafeUntrap solves this problem:
<programlisting>
SafeUntrap ftsize
</programlisting>
__END__
__NAME__ example: Allowing a group of file-related operations
<programlisting>
[set data_file]products/biglist.txt[/set]
[calcn]-r $Scratch->{data_file};[/calcn]
</programlisting>
Adding <literal>:filesys_read</literal> to SafeUntrap solves this problem:
<programlisting>
SafeUntrap :filesys_read
</programlisting>
See the
<citerefentry><refentrytitle>Opcode</refentrytitle>
<manvolnum>3perl</manvolnum></citerefentry> manual page for
more information and the complete list of operation codes and groups.
__END__
Jump to Line
Something went wrong with that request. Please try again.