mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
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.
This commit is contained in:
parent
96a5e50a5d
commit
358e5e17a5
6 changed files with 63 additions and 39 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue