From e1d97c0cff60e22ee40e1b1dd90b481bd14e4d54 Mon Sep 17 00:00:00 2001 From: Meetesh Saini Date: Sat, 18 Jan 2025 22:17:13 +0530 Subject: [PATCH] chore: update comment on Apport core path handling --- pwnlib/elf/corefile.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pwnlib/elf/corefile.py b/pwnlib/elf/corefile.py index cf8119a17..b82dc57e0 100644 --- a/pwnlib/elf/corefile.py +++ b/pwnlib/elf/corefile.py @@ -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