[macruby-changes] [4780] MacRubyWebsite/trunk/content/documentation/the-sandbox-class.txt
source_changes at macosforge.org
source_changes at macosforge.org
Sat Oct 9 12:36:19 PDT 2010
Revision: 4780
http://trac.macosforge.org/projects/ruby/changeset/4780
Author: mattaimonetti at gmail.com
Date: 2010-10-09 12:36:15 -0700 (Sat, 09 Oct 2010)
Log Message:
-----------
Fix mistakes in the Sandbox tutorial.
Default profiles were incorrectly mapped, and I was not explicit enough
about Sandbox.no_writes and Sandbox.temporary_writes
Modified Paths:
--------------
MacRubyWebsite/trunk/content/documentation/the-sandbox-class.txt
Modified: MacRubyWebsite/trunk/content/documentation/the-sandbox-class.txt
===================================================================
--- MacRubyWebsite/trunk/content/documentation/the-sandbox-class.txt 2010-10-09 17:34:32 UTC (rev 4779)
+++ MacRubyWebsite/trunk/content/documentation/the-sandbox-class.txt 2010-10-09 19:36:15 UTC (rev 4780)
@@ -47,15 +47,15 @@
* Sandbox.no_internet
Access by the current process to the internet is restricted.
-* Sandbox.no_networking
+* Sandbox.no_network
Access by the current process to any kind of networking is restricted.
* Sandbox.temporary_writes
- Access by the current process to anywhere *but* /var/tmp and the directory specified by the
- configuration variable _CS_DARWIN_USER_TEMP_DIR.
+ Access by the current process to write to anywhere *but* /var/tmp and the directory specified by
+ the configuration variable _CS_DARWIN_USER_TEMP_DIR.
-* Sandbox.no_filesystem_write
- Access by the current process to anywhere on the filesystem is restricted.
+* Sandbox.no_writes
+ Access by the current process to write to anywhere on the filesystem is restricted.
h3. Initiating a sandbox
@@ -64,7 +64,7 @@
and that is *Sandbox#apply!*. The #apply! method will initiate the sandbox for the current
MacRuby process.
-For example, to apply the <b>Sandbox.pure_computation</b> profile, and create a sandbox for the
+For example, to apply the *Sandbox.pure_computation* profile, and create a sandbox for the
current MacRuby process, you would do the following:
<% coderay :lang => 'ruby' do %>
@@ -116,7 +116,7 @@
begin
Sandbox.pure_computation.apply!
Sandbox.pure_computation.apply!
- rescue SecurityError => e
+rescue SecurityError => e
puts "I couldn't initialize a sandbox!"
end
<% end %>
@@ -124,8 +124,6 @@
The second call to Sandbox.pure_computation.apply! will raise a SecurityError because of restrictions
imposed by the first call to Sandbox.pure_computation.apply!
-
-
h3. Notes
All resources acquired before the sandbox is initialized(Socket objects, File objects, …) are not
@@ -144,3 +142,4 @@
</div>
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20101009/27c80fbf/attachment-0001.html>
More information about the macruby-changes
mailing list