diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-12-14 23:51:22 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-14 23:51:22 (GMT) |
commit | 358e5e17a51ba00742bfaee4557a94c3c4179c22 (patch) | |
tree | 0918046bb6a75f31957b4d0aa24ca73df93d5bbf /Include | |
parent | 96a5e50a5de3683b2afd6d680c7ecc4b525986f6 (diff) | |
download | cpython-358e5e17a51ba00742bfaee4557a94c3c4179c22.zip cpython-358e5e17a51ba00742bfaee4557a94c3c4179c22.tar.gz cpython-358e5e17a51ba00742bfaee4557a94c3c4179c22.tar.bz2 |
bpo-32329: Fix -R option for hash randomization (#4873)
bpo-32329, bpo-32030:
* The -R option now turns on hash randomization when the
PYTHONHASHSEED environment variable is set to 0 Previously, the
option was ignored.
* sys.flags.hash_randomization is now properly set to 0 when hash
randomization is turned off by PYTHONHASHSEED=0.
* _PyCoreConfig_ReadEnv() now reads the PYTHONHASHSEED environment
variable. _Py_HashRandomization_Init() now only apply the
configuration, it doesn't read PYTHONHASHSEED anymore.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/pylifecycle.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Include/pylifecycle.h b/Include/pylifecycle.h index 61ed6cc..0416bfa 100644 --- a/Include/pylifecycle.h +++ b/Include/pylifecycle.h @@ -136,7 +136,13 @@ PyAPI_FUNC(_PyInitError) _PyImportHooks_Init(void); PyAPI_FUNC(int) _PyFrame_Init(void); PyAPI_FUNC(int) _PyFloat_Init(void); PyAPI_FUNC(int) PyByteArray_Init(void); -PyAPI_FUNC(_PyInitError) _Py_HashRandomization_Init(_PyCoreConfig *core_config); +PyAPI_FUNC(_PyInitError) _Py_HashRandomization_Init(const _PyCoreConfig *); +#endif +#ifdef Py_BUILD_CORE +PyAPI_FUNC(int) _Py_ReadHashSeed( + const char *seed_text, + int *use_hash_seed, + unsigned long *hash_seed); #endif /* Various internal finalizers */ |