Safe mode: Difference between revisions
m
syntax highlighting fixup automation
Puppydrum64 (talk | contribs) mNo edit summary |
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
||
Line 18:
=={{header|AWK}}==
<syntaxhighlight lang="awk">
# syntax: GAWK --sandbox -f SAFE_MODE.AWK
#
Line 37:
exit(0)
}
</syntaxhighlight>
<!-- == Free Pascal == -->
Line 47:
The easiest way to test this is to add the <CODE>--sandbox</CODE> option when starting Frink. This enforces the strictest sandboxing mode. Similarly, when creating a Frink interpreter from Java code, the most restrictive security can be enabled by calling its <CODE><I>Frink</I>.setRestrictiveSecurity(true)</CODE> method.
<
frink.parser.Frink interp = new frink.parser.Frink();
interp.setRestrictiveSecurity(true);
</syntaxhighlight>
Below are some operations that can be allowed/disallowed from a custom security manager. For most of these, the permission can be restricted to allow/disallow a ''particular'' file, URL, or class, or method:
Line 95:
For example, given '''safer.jsi''':
<
{{out}}
Line 115:
Some control is allowed over the restrictions provided by safer mode.
<
=={{header|Perl}}==
Line 197:
Regina REXX supports a '''--restricted''' command-line option, and embedded interpreters can also be set to run restricted. Many commands are disabled in this mode, including most access to hosted services. The intrinsic '''FUNCTION REXX()''' extension in GnuCOBOL defaults to restricted mode, and programmers must explicitly use '''FUNCTION REXX-UNRESTRICTED(script, args...)''' for access to the full REXX programming environment from that [[COBOL]] implementation.
<
program-id. rexxtrial.
Line 219:
display "No exception raised: " exception-status
goback.
end program rexxtrial.</
{{out}}
|