[Zope-Checkins] CVS: Zope/lib/python/Zope/Startup - run.py:1.1.2.3

Shane Hathaway shane at zope.com
Tue Feb 3 15:30:07 EST 2004


Update of /cvs-repository/Zope/lib/python/Zope/Startup
In directory cvs.zope.org:/tmp/cvs-serv9487/lib/python/Zope/Startup

Modified Files:
      Tag: Zope-2_7-branch
	run.py 
Log Message:
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.  Now the flag
gets reset so that the implementation can be changed from the default.
Also, Zope.Startup.run.configure() was not applying the security
options.

It might be a good idea to raise an error when you try to change the
security implementation more than once, rather than ignore the attempt.



=== Zope/lib/python/Zope/Startup/run.py 1.1.2.2 => 1.1.2.3 ===
--- Zope/lib/python/Zope/Startup/run.py:1.1.2.2	Sun Dec 21 19:24:25 2003
+++ Zope/lib/python/Zope/Startup/run.py	Tue Feb  3 15:30:06 2004
@@ -23,9 +23,11 @@
     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




More information about the Zope-Checkins mailing list