public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: git-commits@fedoraproject.org
Subject: [rpms/rpm] pmatilai-v6: Add fix for build-ids in non-executable ELF files (#1433837)
Date: Mon, 23 Nov 2026 09:30:47 GMT	[thread overview]
Message-ID: <179542624793.1.8077710371275700505.rpms-rpm-915296ceec45@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/rpm
Branch : pmatilai-v6
Commit : 915296ceec45d0e50490a2c99f47e80a5f1654a2
Author : Mark Wielaard <mark@klomp.org>
Date   : 2017-03-20T10:20:58+01:00
Stats  : +42/-2 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/rpm/c/915296ceec45d0e50490a2c99f47e80a5f1654a2?branch=pmatilai-v6

Log:
Add fix for build-ids in non-executable ELF files (#1433837)

---
diff --git a/0020-build-files-exec-build-id.patch b/0020-build-files-exec-build-id.patch
new file mode 100644
index 0000000..3a27056
--- /dev/null
+++ b/0020-build-files-exec-build-id.patch
@@ -0,0 +1,38 @@
+diff --git a/build/files.c b/build/files.c
+index 6021643..afa01cd 100644
+--- a/build/files.c
++++ b/build/files.c
+@@ -1711,6 +1711,19 @@ static int generateBuildIDs(FileList fl)
+     for (i = 0, flp = fl->files.recs; i < fl->files.used; i++, flp++) {
+ 	struct stat sbuf;
+ 	if (lstat(flp->diskPath, &sbuf) == 0 && S_ISREG (sbuf.st_mode)) {
++	    /* We determine whether this is a main or
++	       debug ELF based on path.  */
++	    #define DEBUGPATH "/usr/lib/debug/"
++	    int isDbg = strncmp (flp->cpioPath,
++				 DEBUGPATH, strlen (DEBUGPATH)) == 0;
++
++	    /* For the main package files mimic what find-debuginfo.sh does.
++	       Only check build-ids for executable files. Debug files are
++	       always non-executable. */
++	    if (!isDbg
++		&& (sbuf.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) == 0)
++	      continue;
++
+ 	    int fd = open (flp->diskPath, O_RDONLY);
+ 	    if (fd >= 0) {
+ 		/* Only real ELF files, that are ET_EXEC, ET_DYN or
+@@ -1732,12 +1745,8 @@ static int generateBuildIDs(FileList fl)
+ 		       is 128 bits) and 64 bytes (largest sha3 is 512
+ 		       bits), common is 20 bytes (sha1 is 160 bits). */
+ 		    if (len >= 16 && len <= 64) {
+-			/* We determine whether this is a main or
+-			   debug ELF based on path.  */
+-			#define DEBUGPATH "/usr/lib/debug/"
+ 			int addid = 0;
+-			if (strncmp (flp->cpioPath,
+-				     DEBUGPATH, strlen (DEBUGPATH)) == 0) {
++			if (isDbg) {
+ 			    needDbg = 1;
+ 			    addid = 1;
+ 			}

diff --git a/rpm.spec b/rpm.spec
index 7a953f3..95cf5a1 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -29,7 +29,7 @@
 Summary: The RPM package management system
 Name: rpm
 Version: %{rpmver}
-Release: %{?snapver:0.%{snapver}.}12%{?dist}
+Release: %{?snapver:0.%{snapver}.}13%{?dist}
 Group: System Environment/Base
 Url: http://www.rpm.org/
 Source0: http://rpm.org/releases/%{srcdir}/%{name}-%{srcver}.tar.bz2
@@ -91,6 +91,7 @@ Patch265: 0016-debugedit-replace-files.patch
 Patch266: 0017-do-not-process-buildi-ds-for-noarch.patch
 Patch267: 0018-update-build-id-endian.patch
 Patch268: 0019-fix-sed-build-id-match-test.patch
+Patch269: 0020-build-files-exec-build-id.patch
 
 # OpenSSL backend
 Patch300: 0001-Add-OpenSSL-support-for-digest-and-signatures.patch
@@ -595,8 +596,9 @@ exit 0
 %doc doc/librpm/html/*
 
 %changelog
-* Mon Mar 20 2017 Mark Wielaard <mjw@redhat.com>
+* Mon Mar 20 2017 Mark Wielaard <mjw@redhat.com> - 4.13.0.1-13
 - Add tests fix for sed file build-id regexp matching.
+- Add fix for build-ids in non-executable ELF files (#1433837).
 
 * Fri Mar 17 2017 Mark Wielaard <mjw@redhat.com> - 4.13.0.1-12
 - Fix reading and updating (cross-endian) build-id information.

                 reply	other threads:[~2026-11-23  9:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179542624793.1.8077710371275700505.rpms-rpm-915296ceec45@fedoraproject.org \
    --to=mark@klomp.org \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox