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 to reset buildid file attributes. (#1432372)
Date: Mon, 23 Nov 2026 09:30:41 GMT	[thread overview]
Message-ID: <179542624173.1.1018301637637603407.rpms-rpm-3e1463c90d00@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/rpm
Branch : pmatilai-v6
Commit : 3e1463c90d00f1ba2ca86b854806e2024816e8a0
Author : Mark Wielaard <mark@klomp.org>
Date   : 2017-03-15T20:13:28+01:00
Stats  : +62/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/rpm/c/3e1463c90d00f1ba2ca86b854806e2024816e8a0?branch=pmatilai-v6

Log:
Add fix to reset buildid file attributes. (#1432372)

---
diff --git a/0015-reset-buildid-file-attrs.patch b/0015-reset-buildid-file-attrs.patch
new file mode 100644
index 0000000..fcc9018
--- /dev/null
+++ b/0015-reset-buildid-file-attrs.patch
@@ -0,0 +1,57 @@
+diff --git a/build/files.c b/build/files.c
+index 6021643..9479e6e 100644
+--- a/build/files.c
++++ b/build/files.c
+@@ -1797,6 +1797,7 @@ static int generateBuildIDs(FileList fl)
+ 	char *mainiddir = NULL;
+ 	char *debugiddir = NULL;
+ 	if (rc == 0) {
++	    char *attrstr;
+ 	    /* Add .build-id directories to hold the subdirs/symlinks.  */
+             #define BUILD_ID_DIR "/usr/lib/.build-id"
+             #define DEBUG_ID_DIR "/usr/lib/debug/.build-id"
+@@ -1804,6 +1805,18 @@ static int generateBuildIDs(FileList fl)
+ 	    mainiddir = rpmGetPath(fl->buildRoot, BUILD_ID_DIR, NULL);
+ 	    debugiddir = rpmGetPath(fl->buildRoot, DEBUG_ID_DIR, NULL);
+ 
++	    /* Make sure to reset all file flags to defaults.
++	       Uses parseForAttr to reset ar, arFlags, and specdFlags.
++	       Note that parseForAttr pokes at the attrstr, so we cannot
++	       just pass a static string. */
++	    fl->def.verifyFlags = RPMVERIFY_ALL;
++	    fl->cur.verifyFlags = RPMVERIFY_ALL;
++	    fl->def.specdFlags |= SPECD_VERIFY;
++	    fl->cur.specdFlags |= SPECD_VERIFY;
++	    attrstr = xstrdup ("%defattr(-,root,root)");
++	    parseForAttr(fl->pool, attrstr, 1, &fl->def);
++	    free (attrstr);
++
+ 	    /* Supported, but questionable.  */
+ 	    if (needMain && needDbg)
+ 		rpmlog(RPMLOG_WARNING,
+@@ -1813,8 +1826,12 @@ static int generateBuildIDs(FileList fl)
+ 		if ((rc = rpmioMkpath(mainiddir, 0755, -1, -1)) != 0) {
+ 		    rpmlog(RPMLOG_ERR, "%s %s: %m\n", errdir, mainiddir);
+ 		} else {
++		    rasprintf (&attrstr, "%s %s", "%attr(-,root,root) ",
++			       mainiddir);
++		    parseForAttr(fl->pool, attrstr, 0, &fl->cur);
+ 		    fl->cur.isDir = 1;
+ 		    rc = addFile(fl, mainiddir, NULL);
++		    free (attrstr);
+ 		}
+ 	    }
+ 
+@@ -1822,8 +1839,12 @@ static int generateBuildIDs(FileList fl)
+ 		if ((rc = rpmioMkpath(debugiddir, 0755, -1, -1)) != 0) {
+ 		    rpmlog(RPMLOG_ERR, "%s %s: %m\n", errdir, debugiddir);
+ 		} else {
++		    rasprintf (&attrstr, "%s %s", "%attr(-,root,root) ",
++			       debugiddir);
++		    parseForAttr(fl->pool, attrstr, 0, &fl->cur);
+ 		    fl->cur.isDir = 1;
+ 		    rc = addFile(fl, debugiddir, NULL);
++		    free (attrstr);
+ 		}
+ 	    }
+ 	}

diff --git a/rpm.spec b/rpm.spec
index ff584da..bc8aad5 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}.}7%{?dist}
+Release: %{?snapver:0.%{snapver}.}8%{?dist}
 Group: System Environment/Base
 Url: http://www.rpm.org/
 Source0: http://rpm.org/releases/%{srcdir}/%{name}-%{srcver}.tar.bz2
@@ -86,6 +86,7 @@ Patch260: 0011-Add-option-to-have-unique-debug-source-dirs-across-v.patch
 Patch261: 0012-generateBuildIDs-Don-t-warn-or-error-for-object-file.patch
 Patch262: 0013-missing_build_ids_terminate_build.patch
 Patch263: 0014-generateBuildIDs-Fix-error-handling.patch
+Patch264: 0015-reset-buildid-file-attrs.patch
 
 # These are not yet upstream
 Patch302: rpm-4.7.1-geode-i686.patch
@@ -587,6 +588,9 @@ exit 0
 %doc doc/librpm/html/*
 
 %changelog
+* Wed Mar 15 2017 Mark Wielaard <mjw@redhat.com> - 4.13.0.1-8
+- Add fix to reset buildid file attributes (#1432372)
+
 * Fri Mar 10 2017 Mark Wielaard <mjw@redhat.com> - 4.13.0.1-7
 - Add fixup fix for build-id warnings on object files (#1430587)
 

                 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=179542624173.1.1018301637637603407.rpms-rpm-3e1463c90d00@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