Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
address a security vulnerability in pyinstaller < 3.6 (#5052)
Browse files Browse the repository at this point in the history
* address a security vulnerability in pyinstaller < 3.6

* Deleted all hooks that are now native pyinstaller hooks

* Cleanup of hook files, this way its easier to keep track of new native hooks

* revert `dns` hook changes

* bring back numpy DLL load hack, but then in hook-golem.py

Co-authored-by: maaktweluit <10008353+maaktweluit@users.noreply.github.com>
  • Loading branch information
shadeofblue and maaktweluit authored Jan 22, 2020
1 parent 22efdae commit ce246a3
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 80 deletions.
2 changes: 1 addition & 1 deletion requirements-build.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ altgraph==0.16.1
future==0.16.0
macholib==1.11
pefile==2017.11.5
PyInstaller==3.3.1
PyInstaller==3.6
23 changes: 0 additions & 23 deletions scripts/pyinstaller/hooks/hook-Crypto.py

This file was deleted.

3 changes: 0 additions & 3 deletions scripts/pyinstaller/hooks/hook-cytoolz.py

This file was deleted.

3 changes: 0 additions & 3 deletions scripts/pyinstaller/hooks/hook-eth_hash.py

This file was deleted.

24 changes: 20 additions & 4 deletions scripts/pyinstaller/hooks/hook-golem.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
from PyInstaller.utils.hooks import collect_submodules
import os
import glob
from PyInstaller.compat import is_win
from PyInstaller.utils.hooks import (
get_module_file_attribute,
collect_submodules,
)


hiddenimports = collect_submodules('golem') + \
collect_submodules('apps') + \
collect_submodules('dns') + \
collect_submodules('os_win') + \
['Cryptodome', 'xml', 'scrypt', 'mock']
collect_submodules('dns')

datas = [
('loggingconfig.py', '.'),
Expand Down Expand Up @@ -40,3 +45,14 @@
'scripts/virtualization'),
('scripts/virtualization/get-hyperv-state.ps1', 'scripts/virtualization')
]

# copy of the native `hooks/hook-numpy.py`, so it will also search DLLs/
binaries = []

if is_win:
extra_dll_locations = ['DLLs']
for location in extra_dll_locations:
dll_glob = os.path.join(os.path.dirname(
get_module_file_attribute('numpy')), location, "*.dll")
if glob.glob(dll_glob):
binaries.append((dll_glob, "."))
1 change: 1 addition & 0 deletions scripts/pyinstaller/hooks/hook-mock.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hiddenimports = ['mock']
35 changes: 0 additions & 35 deletions scripts/pyinstaller/hooks/hook-numpy.core.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from PyInstaller.utils.hooks import collect_submodules

hiddenimports = collect_submodules('PIL')
hiddenimports = collect_submodules('os_win')
1 change: 1 addition & 0 deletions scripts/pyinstaller/hooks/hook-scrypt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hiddenimports = ['scrypt']
10 changes: 0 additions & 10 deletions scripts/pyinstaller/hooks/hook-web3.py

This file was deleted.

0 comments on commit ce246a3

Please sign in to comment.