Changeset 938 for trunk/utils.c
- Timestamp:
- 06/28/2012 12:17:58 PM (11 months ago)
- Files:
-
- 1 modified
-
trunk/utils.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/utils.c
r937 r938 765 765 #endif 766 766 767 xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, ZEND_24(NOTHING, const) char *filename TSRMLS_DC) /* {{{ */767 static xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, ZEND_24(NOTHING, const) char *filename TSRMLS_DC) /* {{{ */ 768 768 { 769 769 HashTable *h; … … 930 930 } 931 931 /* }}} */ 932 void xc_sandbox_free(xc_sandbox_t *sandbox, zend_op_array *op_array TSRMLS_DC) /* {{{ */932 static void xc_sandbox_free(xc_sandbox_t *sandbox, zend_op_array *op_array TSRMLS_DC) /* {{{ */ 933 933 { 934 934 XG(sandbox) = NULL; … … 998 998 } 999 999 /* }}} */ 1000 const Bucket *xc_sandbox_user_function_begin() /* {{{ */ 1000 zend_op_array *xc_sandbox(xc_sandboxed_func_t sandboxed_func, void *data, ZEND_24(NOTHING, const) char *filename TSRMLS_DC) /* {{{ */ 1001 { 1002 xc_sandbox_t sandbox; 1003 zend_op_array *op_array = NULL; 1004 zend_bool catched = 0; 1005 1006 memset(&sandbox, 0, sizeof(sandbox)); 1007 zend_try { 1008 xc_sandbox_init(&sandbox, filename TSRMLS_CC); 1009 op_array = sandboxed_func(data TSRMLS_CC); 1010 } zend_catch { 1011 catched = 1; 1012 } zend_end_try(); 1013 1014 xc_sandbox_free(&sandbox, op_array TSRMLS_CC); 1015 if (catched) { 1016 zend_bailout(); 1017 } 1018 return op_array; 1019 } 1020 /* {{{ */ 1021 const Bucket *xc_sandbox_user_function_begin(TSRMLS_D) /* {{{ */ 1001 1022 { 1002 1023 xc_sandbox_t *sandbox = (xc_sandbox_t *) XG(sandbox); 1003 1024 assert(sandbox); 1004 1025 return TG(internal_function_tail) ? TG(internal_function_tail)->pListNext : TG(function_table).pListHead; 1005 } /* {{{ */ 1006 const Bucket *xc_sandbox_user_class_begin() /* {{{ */ 1026 } 1027 /* {{{ */ 1028 const Bucket *xc_sandbox_user_class_begin(TSRMLS_D) /* {{{ */ 1007 1029 { 1008 1030 xc_sandbox_t *sandbox = (xc_sandbox_t *) XG(sandbox); 1009 1031 assert(sandbox); 1010 1032 return TG(internal_class_tail) ? TG(internal_class_tail)->pListNext : TG(class_table).pListHead; 1011 } /* {{{ */ 1033 } 1034 /* {{{ */ 1012 1035 #ifdef XCACHE_ERROR_CACHING 1013 xc_compilererror_t *xc_sandbox_compilererrors( ) /* {{{ */1036 xc_compilererror_t *xc_sandbox_compilererrors(TSRMLS_D) /* {{{ */ 1014 1037 { 1015 1038 xc_sandbox_t *sandbox = (xc_sandbox_t *) XG(sandbox); 1016 1039 assert(sandbox); 1017 1040 return sandbox->compilererrors; 1018 } /* }}} */ 1019 zend_uint xc_sandbox_compilererror_cnt() /* {{{ */ 1041 } 1042 /* }}} */ 1043 zend_uint xc_sandbox_compilererror_cnt(TSRMLS_D) /* {{{ */ 1020 1044 { 1021 1045 xc_sandbox_t *sandbox = (xc_sandbox_t *) XG(sandbox); 1022 1046 assert(sandbox); 1023 1047 return sandbox->compilererror_cnt; 1024 } /* }}} */1025 #endif 1026 1048 } 1049 /* }}} */ 1050 #endif 1027 1051 1028 1052 int xc_vtrace(const char *fmt, va_list args) /* {{{ */

