Skip to content

Commit ec6b8cd

Browse files
committed
Merge branch 'stable' into beta
2 parents d7a7376 + b2345f2 commit ec6b8cd

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,14 @@ The table below shows which release corresponds to each branch, and what date th
112112
[2476]: https://github.com/Gallopsled/pwntools/pull/2476
113113
[2364]: https://github.com/Gallopsled/pwntools/pull/2364
114114

115+
## 4.14.1
116+
117+
- [#2533][2533] Fix installation on Python 3.5 and lower
118+
- [#2518][2518] fix: update apport coredump path handling for CorefileFinder
119+
120+
[2533]: https://github.com/Gallopsled/pwntools/pull/2533
121+
[2518]: https://github.com/Gallopsled/pwntools/pull/2518
122+
115123
## 4.14.0 (`stable`)
116124

117125
- [#2356][2356] Add local libc database provider for libcdb

pwnlib/elf/corefile.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -1510,7 +1510,18 @@ def apport_coredump(self):
15101510
# should be unique enough that we can just glob.
15111511

15121512
boot_id = read('/proc/sys/kernel/random/boot_id').strip().decode()
1513-
path = self.exe.replace('/', '_')
1513+
1514+
# Use the absolute path of the executable
1515+
# Apport uses the executable's path to determine the core dump filename
1516+
#
1517+
# Reference source:
1518+
# https://github.com/canonical/apport/blob/4bbb179b8f92989bf7c1ee3692074f35d70ef3e8/data/apport#L110
1519+
# https://github.com/canonical/apport/blob/4bbb179b8f92989bf7c1ee3692074f35d70ef3e8/apport/fileutils.py#L599
1520+
#
1521+
# Apport calls `get_core_path` with `options.executable_path`, which corresponds to
1522+
# the executable's pathname, as specified by the `%E` placeholder
1523+
# in the core pattern (see `man core` and `apport --help`).
1524+
path = os.path.abspath(self.exe).replace('/', '_').replace('.', '_')
15141525

15151526
# Format the name
15161527
corefile_name = 'core.{path}.{uid}.{boot_id}.{pid}.*'.format(

pwnlib/libcdb.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import six
1010
import tempfile
1111
import struct
12+
import sys
1213

1314
from pwnlib.context import context
1415
from pwnlib.elf import ELF
@@ -498,7 +499,7 @@ def _extract_tarfile(cache_dir, data_filename, tarball):
498499

499500
def _extract_debfile(cache_dir, package_filename, package):
500501
# Extract data.tar in the .deb archive.
501-
if six.PY2:
502+
if sys.version_info < (3, 6):
502503
if not which('ar'):
503504
log.error('Missing command line tool "ar" to extract .deb archive. Please install "ar" first.')
504505

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ dependencies = [
5656
"colored_traceback<0.4; python_version < '3'",
5757
"colored_traceback; python_version >= '3'",
5858
"pathlib2; python_version < '3.4'",
59-
"unix-ar; python_version >= '3'",
59+
"unix-ar; python_version >= '3.6'",
6060
"zstandard",
6161
]
6262

0 commit comments

Comments
 (0)