From eae5d6c4ebe09e3dfe205b8713b2480ba6238a30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20R=C3=B6hling?= Date: Mon, 11 Apr 2022 12:03:39 +0200 Subject: Remove check for unneeded development headers Gbp-Pq: Name 0001-Remove-check-for-unneeded-development-headers.patch --- setup.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/setup.py b/setup.py index e6bb612..15695f9 100755 --- a/setup.py +++ b/setup.py @@ -54,12 +54,6 @@ if sys.version_info < (3, 4): sys.argv.remove('--user') -# Check that the user has installed the Python development headers -PythonH = os.path.join(get_python_inc(), 'Python.h') -if not os.path.exists(PythonH): - print("You must install the Python development headers!", file=sys.stderr) - print("$ apt-get install python-dev", file=sys.stderr) - sys.exit(-1) setup( version = '4.11.0', -- cgit v1.2.3 From c7db57c2d518f2781e88ef2182e1b5cebec70b0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20R=C3=B6hling?= Date: Mon, 11 Apr 2022 12:04:19 +0200 Subject: Do not pollute /usr/bin with random scripts Gbp-Pq: Name 0002-Do-not-pollute-usr-bin-with-random-scripts.patch --- setup.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/setup.py b/setup.py index 15695f9..bfe7e19 100755 --- a/setup.py +++ b/setup.py @@ -25,24 +25,6 @@ for scheme in INSTALL_SCHEMES.values(): console_scripts = ['pwn=pwnlib.commandline.main:main'] -# Find all of the ancillary console scripts -# We have a magic flag --include-all-scripts -flag = '--only-use-pwn-command' -if flag in sys.argv: - sys.argv.remove(flag) -else: - flag = False - -for filename in glob.glob('pwnlib/commandline/*'): - filename = os.path.basename(filename) - filename, ext = os.path.splitext(filename) - - if ext != '.py' or '__init__' in filename: - continue - - script = '%s=pwnlib.commandline.common:main' % filename - if not flag: - console_scripts.append(script) compat = {} if sys.version_info < (3, 4): -- cgit v1.2.3 From 8bd352914af1aac2d0694a57a4aa53ec416f61dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20R=C3=B6hling?= Date: Mon, 11 Apr 2022 12:49:14 +0200 Subject: Do not install documentation to /usr/lib/python3 Gbp-Pq: Name 0003-Do-not-install-documentation-to-usr-lib-python3.patch --- setup.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/setup.py b/setup.py index bfe7e19..5421041 100755 --- a/setup.py +++ b/setup.py @@ -11,6 +11,7 @@ from distutils.command.install import INSTALL_SCHEMES from distutils.sysconfig import get_python_inc from distutils.util import convert_path +from setuptools import find_packages from setuptools import setup # Get all template files @@ -39,9 +40,6 @@ if sys.version_info < (3, 4): setup( version = '4.11.0', - data_files = [('pwntools-doc', - glob.glob('*.md') + glob.glob('*.txt')), - ], package_data = { 'pwnlib': [ 'data/crcsums.txt', -- cgit v1.2.3 From 24f0ead3efd83eeb385a20a2477b330a4e29c88c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20R=C3=B6hling?= Date: Mon, 11 Apr 2022 14:06:33 +0200 Subject: Use python3 in doctests Gbp-Pq: Name 0004-Use-python3-in-doctests.patch --- pwnlib/tubes/process.py | 8 ++++---- pwnlib/tubes/ssh.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pwnlib/tubes/process.py b/pwnlib/tubes/process.py index 8770ade..1449994 100644 --- a/pwnlib/tubes/process.py +++ b/pwnlib/tubes/process.py @@ -117,7 +117,7 @@ class process(tube): Examples: - >>> p = process('python') + >>> p = process('python3') >>> p.sendline(b"print('Hello world')") >>> p.sendline(b"print('Wow, such data')") >>> b'' == p.recv(timeout=0.01) @@ -158,20 +158,20 @@ class process(tube): >>> p.recv() b'\x00\x00\x00\x00\x00\x00\x00\x00' - >>> p = process(['python','-c','import os; print(os.read(2,1024).decode())'], + >>> p = process(['python3','-c','import os; print(os.read(2,1024).decode())'], ... preexec_fn = lambda: os.dup2(0,2)) >>> p.sendline(b'hello') >>> p.recvline() b'hello\n' - >>> stack_smashing = ['python','-c','open("/dev/tty","wb").write(b"stack smashing detected")'] + >>> stack_smashing = ['python3','-c','open("/dev/tty","wb").write(b"stack smashing detected")'] >>> process(stack_smashing).recvall() b'stack smashing detected' >>> process(stack_smashing, stdout=PIPE).recvall() b'' - >>> getpass = ['python','-c','import getpass; print(getpass.getpass("XXX"))'] + >>> getpass = ['python3','-c','import getpass; print(getpass.getpass("XXX"))'] >>> p = process(getpass, stdin=PTY) >>> p.recv() b'XXX' diff --git a/pwnlib/tubes/ssh.py b/pwnlib/tubes/ssh.py index adda422..6aee6e0 100644 --- a/pwnlib/tubes/ssh.py +++ b/pwnlib/tubes/ssh.py @@ -384,7 +384,7 @@ class ssh_process(ssh_channel): Examples: >>> s = ssh(host='example.pwnme') - >>> p = s.process(['python', '-c', 'import time; time.sleep(10)']) + >>> p = s.process(['python3', '-c', 'import time; time.sleep(10)']) >>> hex(p.getenv('PATH')) # doctest: +ELLIPSIS '0x...' """ @@ -846,7 +846,7 @@ class ssh(Timeout, Logger): b'/tmp\n' >>> io.cwd '/tmp' - >>> p = s.process(['python','-c','import os; os.write(1, os.read(2, 1024))'], stderr=0) + >>> p = s.process(['python3','-c','import os; os.write(1, os.read(2, 1024))'], stderr=0) >>> p.send(b'hello') >>> p.recv() b'hello' -- cgit v1.2.3 From 36462261ed10fbb4484d880412961ebe524f733d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20R=C3=B6hling?= Date: Mon, 11 Apr 2022 20:23:41 +0200 Subject: Disable automatic update check Gbp-Pq: Name 0005-Disable-automatic-update-check.patch --- pwnlib/update.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/pwnlib/update.py b/pwnlib/update.py index dd8f0ed..4805bf7 100644 --- a/pwnlib/update.py +++ b/pwnlib/update.py @@ -117,15 +117,8 @@ def last_check(): def should_check(): """Return True if we should check for an update""" - filename = cache_file() - - if not filename: - return False - - if disabled or read(filename).strip() == b'never': - return False - - return time.time() > (last_check() + update_freq) + # Never check automatically for Debian + return False def perform_check(prerelease=current_version.is_prerelease): """Perform the update check, and report to the user. -- cgit v1.2.3