Skip to content

Commit

Permalink
Merge branch 'stable' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
peace-maker committed Jan 26, 2025
2 parents d7a7376 + b2345f2 commit ec6b8cd
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ The table below shows which release corresponds to each branch, and what date th
[2476]: https://github.com/Gallopsled/pwntools/pull/2476
[2364]: https://github.com/Gallopsled/pwntools/pull/2364

## 4.14.1

- [#2533][2533] Fix installation on Python 3.5 and lower
- [#2518][2518] fix: update apport coredump path handling for CorefileFinder

[2533]: https://github.com/Gallopsled/pwntools/pull/2533
[2518]: https://github.com/Gallopsled/pwntools/pull/2518

## 4.14.0 (`stable`)

- [#2356][2356] Add local libc database provider for libcdb
Expand Down
13 changes: 12 additions & 1 deletion pwnlib/elf/corefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1510,7 +1510,18 @@ def apport_coredump(self):
# should be unique enough that we can just glob.

boot_id = read('/proc/sys/kernel/random/boot_id').strip().decode()
path = self.exe.replace('/', '_')

# Use the absolute path of the executable
# Apport uses the executable's path to determine the core dump filename
#
# Reference source:
# https://github.com/canonical/apport/blob/4bbb179b8f92989bf7c1ee3692074f35d70ef3e8/data/apport#L110
# https://github.com/canonical/apport/blob/4bbb179b8f92989bf7c1ee3692074f35d70ef3e8/apport/fileutils.py#L599
#
# Apport calls `get_core_path` with `options.executable_path`, which corresponds to
# the executable's pathname, as specified by the `%E` placeholder
# in the core pattern (see `man core` and `apport --help`).
path = os.path.abspath(self.exe).replace('/', '_').replace('.', '_')

# Format the name
corefile_name = 'core.{path}.{uid}.{boot_id}.{pid}.*'.format(
Expand Down
3 changes: 2 additions & 1 deletion pwnlib/libcdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import six
import tempfile
import struct
import sys

from pwnlib.context import context
from pwnlib.elf import ELF
Expand Down Expand Up @@ -498,7 +499,7 @@ def _extract_tarfile(cache_dir, data_filename, tarball):

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

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ dependencies = [
"colored_traceback<0.4; python_version < '3'",
"colored_traceback; python_version >= '3'",
"pathlib2; python_version < '3.4'",
"unix-ar; python_version >= '3'",
"unix-ar; python_version >= '3.6'",
"zstandard",
]

Expand Down

0 comments on commit ec6b8cd

Please sign in to comment.