[Zope3-checkins] CVS: Zope3/lib/python/Zope/Security - Checker.py:1.16
runyaga
runyaga@thisbox.com
Fri, 6 Dec 2002 09:55:43 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/Security
In directory cvs.zope.org:/tmp/cvs-serv15802
Modified Files:
Checker.py
Log Message:
Removed unused lists of names for protecting BTrees. These should have
been removed earlier, when the BTrees security check directives were
moved into Zope/App/Security.
Allowed the names __str__ and __repr__ for lists, tuples and dicts.
This allows you to see a decent string representation of these things
from untrusted code.
(Commit message from SteveA)
=== Zope3/lib/python/Zope/Security/Checker.py 1.15 => 1.16 ===
--- Zope3/lib/python/Zope/Security/Checker.py:1.15 Tue Dec 3 09:12:54 2002
+++ Zope3/lib/python/Zope/Security/Checker.py Fri Dec 6 09:55:43 2002
@@ -335,32 +335,6 @@
'__module__', '__bases__', 'getBases',
'isImplementedBy', 'extends'])
-# excluding _check, _bucket_type, _firstbucket, and write operations
-_btreeChecker = NamesChecker(['__str__', '__repr__', '__contains__',
- '__getitem__', '__iter__', '__len__',
- 'byValue', 'get', 'has_key', 'items',
- 'iteritems', 'iterkeys', 'itervalues',
- 'keys', 'maxKey', 'minKey', 'values'])
-
-# excluding _next
-_btreeBucketChecker = NamesChecker([
- '__contains__', '__getitem__', '__iter__', '__len__', '__repr__',
- '__str__', 'byValue', 'get', 'has_key', 'items', 'iteritems',
- 'iterkeys', 'itervalues', 'keys', 'maxKey','minKey', 'values'])
-
-_btreeSetChecker = NamesChecker([
- '__contains__', '__getitem__', '__iter__', '__len__', '__repr__',
- '__str__', 'has_key', 'insert', 'keys', 'maxKey', 'minKey'])
-
-# excluding _bucket_type, _check
-_btreeTreeSetChecker = NamesChecker([
- '__contains__', '__iter__', '__len__', '__repr__',
- '__str__', 'has_key', 'insert', 'keys', 'maxKey', 'minKey'])
-
-_btreeItemsChecker = NamesChecker([
- '__iter__', '__repr__', '__str__', '__getitem__', '__len__',
- '__contains__'])
-
_iteratorChecker = NamesChecker(['next'])
BasicTypes = {
@@ -381,16 +355,18 @@
_default_checkers = {
dict: NamesChecker(['__getitem__', '__len__', '__iter__',
- 'get', 'has_key', '__copy__',
+ 'get', 'has_key', '__copy__', '__str__', '__repr__',
'keys', 'values', 'items',
'iterkeys', 'iteritems', 'itervalues', '__contains__',
]),
list: NamesChecker(['__getitem__', '__getslice__', '__len__', '__iter__',
- '__contains__', 'index', 'count']),
+ '__contains__', 'index', 'count', '__str__',
+ '__repr__']),
# YAGNI: () a rock
tuple: NamesChecker(['__getitem__', '__getslice__', '__add__',
- '__contains__', '__len__', '__iter__', '__iadd__']),
+ '__contains__', '__len__', '__iter__', '__iadd__',
+ '__str__', '__repr__']),
types.InstanceType: _instanceChecker,
Proxy: NoProxy,
types.ClassType: _classChecker,