mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Turn on hash randomization in the version of python bundled with calibre
This commit is contained in:
parent
880c889a23
commit
b4cfdbbf32
@ -183,6 +183,7 @@ void initialize_interpreter(int argc, char **argv, char *outr, char *errr,
|
||||
Py_NoUserSiteDirectory = 1;
|
||||
Py_VerboseFlag = 0;
|
||||
Py_DebugFlag = 0;
|
||||
Py_HashRandomizationFlag = 1;
|
||||
|
||||
Py_SetProgramName(exe_path);
|
||||
Py_SetPythonHome(base_dir);
|
||||
|
@ -55,6 +55,7 @@ void initialize_interpreter(const char **ENV_VARS, const char **ENV_VAR_VALS,
|
||||
Py_DontWriteBytecodeFlag = 1;
|
||||
Py_IgnoreEnvironmentFlag = 1;
|
||||
Py_NoUserSiteDirectory = 1;
|
||||
Py_HashRandomizationFlag = 1;
|
||||
|
||||
//Py_VerboseFlag = 1;
|
||||
//Py_DebugFlag = 1;
|
||||
|
@ -319,6 +319,9 @@ void initialize_interpreter(wchar_t *outr, wchar_t *errr,
|
||||
flag = (int*)GetProcAddress(dll, "Py_NoUserSiteDirectory");
|
||||
if (!flag) ExitProcess(_show_error(L"Failed to get user_site flag", L"", 1));
|
||||
*flag = 1;
|
||||
flag = (int*)GetProcAddress(dll, "Py_HashRandomizationFlag ");
|
||||
if (!flag) ExitProcess(_show_error(L"Failed to get hash randomization flag", L"", 1));
|
||||
*flag = 1;
|
||||
flag = (int*)GetProcAddress(dll, "Py_VerboseFlag");
|
||||
if (!flag) ExitProcess(_show_error(L"Failed to get verbose flag", L"", 1));
|
||||
//*flag = 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user