On 17 April 2012 10:06, Luke Macken <[email protected]> wrote: > On Sun, Apr 15, 2012 at 08:02:58PM +1000, Graham Dumpleton wrote: >> 1. Means of turning on hash seed randomisation with recent updates of >> Python. I still have a few issues to sort out here. I was supplied a >> patch, but it doesn't go far enough and deal adequately with issues >> like upgrading patch levels of Python against a mod_wsgi compiled >> against an older version. It also didn't allow hash seeding, only >> randomisation. > > Attached is a patch that solves both of these problems. > > This creates a WSGIPythonHashSeed option, which gets set to the > PYTHONHASHSEED environment variable. This option accepts either 'random' > or seed values 0-4294967295. > > Thoughts?
Needs to be a bit more complicated than that I suspect. Because it can be set to a specific seed, I don't believe you can make the assumption that one should allow that environment variable to be inherited by sub process as that would then affected any Python programs you might run from the process. What I was likely to do was to set the environment variable, but defer doing that until just before Python interpreter initialised. Then after interpreter initialised, unset the environment variable from C process level. This does though still leave it with os.environ of the main interpreter, so may have to be removed manually from that. The other thing contending with is whether you allow this to be set differently for different daemon process groups, or just once globally for the whole Apache and mod_wsgi daemon processes. Graham -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
