[macruby-changes] [5122] MacRuby/trunk/sandbox.c

source_changes at macosforge.org source_changes at macosforge.org
Wed Jan 5 14:26:54 PST 2011


Revision: 5122
          http://trac.macosforge.org/projects/ruby/changeset/5122
Author:   pthomson at apple.com
Date:     2011-01-05 14:26:48 -0800 (Wed, 05 Jan 2011)
Log Message:
-----------
Add a check to ensure empty sandboxes aren't applied; fixes ticket 1025

Modified Paths:
--------------
    MacRuby/trunk/sandbox.c

Modified: MacRuby/trunk/sandbox.c
===================================================================
--- MacRuby/trunk/sandbox.c	2011-01-05 13:48:02 UTC (rev 5121)
+++ MacRuby/trunk/sandbox.c	2011-01-05 22:26:48 UTC (rev 5122)
@@ -86,6 +86,9 @@
     rb_sandbox_t *box;
     Data_Get_Struct(self, rb_sandbox_t, box);
     char *error = NULL;
+    if (box->profile == NULL || box->flags == 0) { 
+ 		rb_raise(rb_eRuntimeError, "sandbox must have non-empty profile."); 
+ 	}
     if (sandbox_init(box->profile, box->flags, &error) == -1) {
         rb_raise(rb_eSecurityError, "Couldn't apply sandbox: `%s`", error);
     }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20110105/7df7cee9/attachment.html>


More information about the macruby-changes mailing list