Commit 17568f78 authored by Shane Hathaway's avatar Shane Hathaway

Until now, the security-policy-implementation directive had no effect.

When Implementation.py set the default policy, it set the
_implementation_set flag, preventing further changes.  Also,
Zope.Startup.run.configure() was not applying the security options.
parent a53155a4
......@@ -96,3 +96,6 @@ _policy_names = {
# start with the default, mostly because we need something for the tests
setImplementation("C")
# allow the implementation to change from the default
_implementation_set = 0
......@@ -23,9 +23,11 @@ def configure(configfile):
Zope before attempting to do 'app = Zope.app(). Should be used as
follows: from Zope.Startup.run import configure;
configure('/path/to/configfile'); import Zope; app = Zope.app() """
from Zope.Startup import dropPrivileges
from Zope.Startup import ZopeStarter
opts = _setconfig(configfile)
dropPrivileges(opts.configroot)
starter = ZopeStarter(opts.configroot)
starter.setupSecurityOptions()
starter.dropPrivileges()
def _setconfig(configfile=None):
""" Configure a Zope instance based on ZopeOptions. Optionally
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment