Skip to content

Commit

Permalink
chore: update comment on Apport core path handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Meetesh-Saini committed Jan 18, 2025
1 parent 5aafbc5 commit e1d97c0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pwnlib/elf/corefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1512,7 +1512,15 @@ def apport_coredump(self):
boot_id = read('/proc/sys/kernel/random/boot_id').strip().decode()

# Use the absolute path of the executable
# Apport uses the executable's pathname in the core filename
# 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
Expand Down

0 comments on commit e1d97c0

Please sign in to comment.