none
[openafs-wiki.git] / TWiki / TWikiSandboxDotPm.mdwn
1 # <a name="Package &lt;code&gt;TWiki::Sandbox="></a> Package =TWiki::Sandbox
2
3 This object provides an interface to the outside world. All calls to system functions, or handling of file names, should be brokered by this object.
4
5 <div>
6   <ul>
7     <li><a href="#Package =TWiki::Sandbox="> Package TWiki::Sandbox</a><ul>
8         <li><a href="#ClassMethod <strong>new</strong> ($os,$realOS)"> ClassMethod new <tt>($os,$realOS)</tt></a></li>
9         <li><a href="#StaticMethod *untaintUnchecked*"> StaticMethod untaintUnchecked <tt>($string) -&gt; $untainted</tt></a></li>
10         <li><a href="#StaticMethod *normalize_FileName"> StaticMethod normalizeFileName <tt>($string) -&gt; $filename</tt></a></li>
11         <li><a href="#ObjectMethod <strong>sysCommand</strong> ($temp"> ObjectMethod sysCommand <tt>($template,@params) -&gt; ($data,$exit)</tt></a></li>
12       </ul>
13     </li>
14   </ul>
15 </div>
16
17 ## <a name="ClassMethod &lt;strong&gt;new&lt;/strong&gt; ($os,$realOS)"></a> [[ClassMethod]] **new** `($os,$realOS)`
18
19 Construct a new sandbox suitable for $os, setting flags for platform features that help. $realOS distinguishes Perl variants on platforms such as Windows.
20
21 ## <a name="StaticMethod &lt;strong&gt;untaintUnchecked*"></a><a name="StaticMethod *untaintUnchecked&lt;/strong&gt; "></a> [[StaticMethod]] **untaintUnchecked** `($string) -> $untainted`
22
23 Untaints $string without any checks (dangerous). If $string is undefined, return undef.
24
25 The intent is to use this routine to be able to find all untainting places using grep.
26
27 ## <a name="StaticMethod &lt;strong&gt;normalize_FileName"></a> [[StaticMethod]] \*normalizeFileName `($string) -> $filename`
28
29 STATIC Errors out if $string contains filtered characters.
30
31 The returned string is not tainted, but it may contain shell metacharacters and even control characters.
32
33 ## <a name="ObjectMethod &lt;strong&gt;sysCommand&lt;/strong&gt; ($temp"></a> [[ObjectMethod]] **sysCommand** `($template,@params) -> ($data,$exit)`
34
35 Invokes the program described by $template and @params, and returns the output of the program and an exit code. STDOUT is returned. STDERR is THROWN AWAY.
36
37 The caller has to ensure that the invoked program does not react in a harmful way to the passed arguments. sysCommand merely ensures that the shell does not interpret any of the passed arguments.