Allow python StringIO type to enable seek in restricted python
... | @@ -180,11 +180,13 @@ allow_type(type(re.compile(''))) | ... | @@ -180,11 +180,13 @@ allow_type(type(re.compile(''))) |
allow_type(type(re.match('x','x'))) | allow_type(type(re.match('x','x'))) | ||
allow_type(type(re.finditer('x','x'))) | allow_type(type(re.finditer('x','x'))) | ||
import cStringIO | import cStringIO, StringIO | ||
f = cStringIO.StringIO() | f_cStringIO = cStringIO.StringIO() | ||
f_StringIO = StringIO.StringIO() | |||
allow_module('cStringIO') | allow_module('cStringIO') | ||
allow_module('StringIO') | allow_module('StringIO') | ||
allow_type(type(f)) | allow_type(type(f_cStringIO)) | ||
allow_type(type(f_StringIO)) | |||
|
|||
ModuleSecurityInfo('cgi').declarePublic('escape', 'parse_header') | ModuleSecurityInfo('cgi').declarePublic('escape', 'parse_header') | ||
allow_module('datetime') | allow_module('datetime') | ||
... | ... |
-
@jerome Regarding the commit 24a5d995, you are absolutely right. Thank you for your great finding.
f_StringIO = StringIO.StringIO() ...(snip) allow_type(type(f_StringIO))
It was surely intended to allow StringIO.StringIO() only. We overlooked the fact that the type was
<type 'instance'>
.If you need some help to fixing the test failures regarding this issue (revert to not allowing 'instance'), please let me know it.
Again, Thank you.
-
Owner
@tatuya thank you. About test failures, it seems ERP5 test suite is now OK in !1090 (merged) . There might be small not tested things that will break, or problems in project tests, but we can fix later I believe.