]> git.ipfire.org Git - thirdparty/elfutils.git/commit
debuginfod-client.c: Download section even if cached executable didn't contain it.
authorAaron Merey <amerey@redhat.com>
Wed, 8 Feb 2023 02:15:33 +0000 (21:15 -0500)
committerAaron Merey <amerey@redhat.com>
Wed, 8 Feb 2023 02:15:33 +0000 (21:15 -0500)
commit53b596ef4018693403395d702045c15762af3da7
tree7d43d812b2341e054cc647be1b2d6a33fcadd2a2
parent45576ab5f24cd39669a418fa8e005b4d04f8e9ca
debuginfod-client.c: Download section even if cached executable didn't contain it.

Before attempting to download a section, cache_find_section tries to
extract the section from existing files in the cache. If it's determined
that the section must not exist, cache_find_section returns -ENOENT to
indicate that the download should be skipped.

This patch fixes a bug where cache_find_section returns -ENOENT even
though the section exists.  If the cache contains the executable but
not the debuginfo with the given build-id and the section only exists
in the debuginfo (such as any of the .debug_* sections), then
debuginfod_find_section returns -ENOENT even if the section could be
downloaded.

Fix this by having cache_find_section not return -ENOENT unless cached
debuginfo was able to be read.

Signed-off-by: Aaron Merey <amerey@redhat.com>
debuginfod/ChangeLog
debuginfod/debuginfod-client.c