| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
| |
Doesn't really change anything as such but seems saner this way
and also makes the keyid more readily available.
|
|
|
|
|
| |
This hasn't been built since commit 41d0a9fd3e8615efbb333746dfd2ea1ad9e285e3
almost ten years ago, just maybe we can actually drop it too...
|
|
|
|
|
| |
Hopefully resurrecting whatever got broken by the round of changes
surrounding this, __progname is not an entirely glibc/linux thing.
|
|
|
|
|
|
| |
This way we dont need to include separate tests for the entire
BSD'ish family tree and who knows, might even cover some other
cases too.
|
|
|
|
|
|
|
| |
It can be dropped because this code was never actually enabled.
Actually, this implementation *surely* never ever compiled.
Signed-off-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
|
|
|
|
|
| |
Exposed by commit cf6c87997f199b7681934b5d7c524bfff178b848 which
includes system.h which includes the NLS stuff.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, there is no harm if config.h is not included in these files
because they are not sensitive to macros defined in config.h, but any
code added later or any plugin created using these plugins as examples
might be affected by these macros and therefore has to include config.h.
An example of bug when this header is not included properly can be seen
in the previous commit.
Signed-off-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
|
|
|
|
|
|
|
|
|
|
| |
plugin
This problem was found by ALT rpm verify-elf brp script:
verify-elf: WARNING: ./usr/lib/rpm-plugins/systemd_inhibit.so: uses non-LFS functions: __lxstat
verify-elf: WARNING: ./usr/lib/rpm/sepdebugcrcfix: uses non-LFS functions: __xstat mmap open pread pwrite
Signed-off-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Older versions of glibc included an fts implementation that didn't have
Large File Support on 32-bit systems. We worked that around by bundling
fts into rpm codebase. Thanks to Mark Wielaard, glibc >= 2.23 has LFS
support in fts.
Unfortunately, we can't drop bundled fts because we have to support
build with other libcs which do not implement fts at all or their
implementations do not provide Large File Support.
Signed-off-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
[pmatilai: Added comment to configure.ac as the test is rather subtle,
thanks for Mark Wielaard for the explanation]
|
|
|
|
|
|
| |
Make sure local fts.h is never included by mistake instead of system one.
Signed-off-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
|
|
|
|
|
|
|
| |
mainiddir and debugiddir are allocated through rpmGetPath ()
and should be released when done.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
| |
Testing for correct behavior in failure case is harder because of
all the environment (arch etc) dependent variablees in the output
but success is easy. Would've caught the buildid-caused regression...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit bbfe1f86b2e4b5c0bd499d9f3dd9de9c9c20fff2 broke short-circuited
binary builds (which can be handy for testing when working on large
packages), eg:
rpmbuild -bi foo.spec; rpmbuild -bb --short-circuit foo.spec
The problem is that in a short-circuited build all the links already
exist and point to the right place, but the code doesn't realize this
and creates new links instead, which leaves the old links unowned
in the buildroot which ultimately causes the build to fail with
"Installed (but unpackaged) file(s) found" for the previously created
build-id links.
When checking for pre-existing links see if they already point to
the right file and in that case just reuse it instead of creating new ones.
Keep track of duplicate build-ids found by noticing existing links that
point to different targets. But don't do this for compat links, they should
just point to the last (duplicate) main build-id symlink found.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We would put one too many slashes in between the new dest_dir and file name
part of the replacement of a DW_FORM_string in the .debug_info. If there
was file part then we would overwrite the first character of the name. If
there was no file part at all then this would overwrite the zero terminator
and cause a crash reading the rest of the data.
A crash did happen while building the docker package on fedora s390x.
https://bugzilla.redhat.com/show_bug.cgi?id=1434347
The reason neither issue would normally trigger is because if we do detect
that the dest_dir is larger than the base_dir we refuse to replace anything.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
| |
|
|
|
|
|
|
|
|
|
| |
Like commit f0a5819 for rpmbuild.at. In the case of rpmbuildid.at the
sed expression looked to work, but only matched by accident. Make the sed
regexp more strict by only matching a hex-string. And properly "escape"
[ and ] which inside an AT_CHECK should be [[ and ]].
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[Note this patch is currently being tested in Fedora. See bug below.]
When creating the build-id directories we should reset the file attributes
to the defaults. Otherwise if the file list contained an %attr or %defattr
the directories would come out with the wrong mode.
Includes a testcase based on a spec by Igor Gnatenko that fails before
and Check that build-id directories are created with the right permissions
even if the spec file sets attrs explicitly.
https://bugzilla.redhat.com/show_bug.cgi?id=1432372
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
We wouldn't replace the changed file names if replace_dirs was false,
but replace_files was true. This could overrun the new debug_line data
buffer if the original file name was larger than the replacement. It
wasn't found before because often when we need to replace files we
also would have to replace dirs.
This fixes the kubernetes build in fedora.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
debugedit doesn't read raw mmap data any longer. Which made the complex
way to read the build-id unnecessary (and it was broken for cross-endian).
Just use gelf_getnote to read the notes.
Also in some special cases when only the debug_info or build_id data
was updated, but no section changed size and we had to preserve the
allocated section headers we could hit a bug in elfutils that could
trash some section data in case there were gaps between non-dirty and
dirty sections. See https://sourceware.org/bugzilla/show_bug.cgi?id=21199
Add a workaround for that issue.
This fixes the kompose package build on fedora ppc64.
And makes it possible to replicate that issue on x86_64.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
|
|
| |
We don't want to do build-id processing for noarch packages. It might be
that noarch packages do contain architecture depended files, but those are
already handled by processBinaryFiles.
This fixes the building of openbios in fedora.
https://bugzilla.redhat.com/show_bug.cgi?id=1433129
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
generateBuildIDs should mimic what find-debuginfo.sh does. Only check
build-ids for executable files in non-debuginfo packages. This moves the
isDbg check up so the is executeble check can be done when the file is
part of the main package.
This fixes the build of qemu and uboot-tools in fedora. Both ship
non-executable ELF bios files in architecture specific packages.
https://bugzilla.redhat.com/show_bug.cgi?id=1433837
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
| |
What installSpecialDoc argument really means is "did we execute %install
stage?" That the information is used for detecting whether special %doc
should be installed or not is another question.
No functional changes, but this makes the information saner to use for
other purposes.
|
|
|
|
|
| |
readelf used to append a bogus tab to the --debug-dump=info
output. Add a sed call to get rid of it.
|
|
|
|
| |
Installation of FA_TOUCH item only upgrades its metadata.
|
|
|
|
|
|
|
|
|
|
|
| |
The previous incarnations of hello-2.0-1.i686.rpm and hello-2.0-1.x86_64.rpm
were built during the "tri-state boolean bug period", ie between commits
b5d54b35d4bc2745b73f4b75bdebed36abce7ed1 (being technically correct doesn't
help when underlying assumptions don't hold) and
da3a3a14e757ccd517e2eb2a3f0293ff48b3ff7f, causing the last tags
added in packages to be out of order when written to disk.
Rebuilding gets us correctly ordered headers plus new digests and all.
|
|
|
|
|
|
|
| |
The original hello-2.0-1.i686.rpm and hello-2.0-1.x86_64.rpm were
built during the "tri-state boolean bug period", ie between commits
359baa2831dd1850cba3a1cc8d31aebf883a5138
da3a3a14e757ccd517e2eb2a3f0293ff48b3ff7f
|
|
|
|
|
|
|
|
| |
Replace home-grown buggy imitation of getline(3) with use of getline(3).
Fixes: 92a8babf1b46 ("Remove hopefully the last static buffer in rpm spec reading")
Closes: https://github.com/rpm-software-management/rpm/issues/175
Signed-off-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before only
var = <<BLOCK
foo
BLOCK
was skipped.
But
my var = <<BLOCK
is also valid perl and needs to be skipped for dependency scanning.
|
| |
|
|
|
|
| |
Should've been in commit 86c523da6fa1cada0c5753c14bb1f2fdd436d28d
|
|
|
|
|
|
|
|
|
|
|
|
| |
Resetting priorities against daemons inheriting nice'd properties
from rpm is a workaround needed only on legacy SysV init systems,
but in systemd era this is nothing but counter-productive. So make
the functionality optional by moving it into a plugin.
This probably breaks the testcase because now we'd somehow need to
determine from the testsuite whether the plugin will be loaded or not,
but since the test is only enabled as root ... maybe its not that big
a deal.
|
|
|
|
|
|
|
|
| |
Historically we have only checked build_ids when __debug_package was
defined. So don't terminate the build if __debug_package is unset, even
when _missing_build_ids_terminate_build is. Only warn.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
commit e6bdf7 made it so that we don't give a warning or error message
for non-kernel ET_REL object files with missing or bad build-ids. But
we still (unintentionally) failed generateBuildIDs which made us skip
generating the cpioList causing an obscure failure message.
Move the sanity check earlier so we don't process such object files at
all. And if there is any real error from generateBuildIDs give a clear
error message and explicitly set processingFailed.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
| |
|
|
|
|
| |
Broken with 9d5bbd9774d00f50749bb045217eaf91c87b6de0
|
|
|
|
|
|
|
|
| |
Only loadable ELF images (executables, shared libraries, kernel modules)
should have build-ids. So don't warn or error out when an object file is
found without one.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
| |
Should've been in commit 0cd74ade37d16d282d13e781deb68a219b2c04b9
|
|
|
|
|
|
|
|
|
| |
As in, honor --nodigest for the new compressed payload digest too.
There's now _RPMVSF_NOPAYLOAD and RPMVSF_NOPAYLOAD meaning entirely
different things, there might be some confusion on the road ahead.
Better names for these things would be welcome...
Should've really been in commit daeb53bae7da50102c9114b8672ea4dd679d74cd.
|
|
|
|
|
|
|
|
|
| |
As a part of modernizing the crypto used by rpm, it's way past time
to use a stronger algorithm for the file digests. The jump from MD5
is not entirely smooth but at least Fedora and RHEL did that ages ago
and survived, others should too. And of course you can always flip
it back to MD5 if you really need to, for eg building packages for
ancient distro versions.
|
|
|
|
|
|
|
|
|
|
|
| |
SHA1 has been getting a bit long in the tooth for many years by now,
add a more modern digest to eventually supplant it, for now just
prefer SHA256 over SHA1 if present when verifying. Using a hardwired
algorithm instead of configurable one to keep things on the simple
side when dealing with the signature header.
Signing could add the new digest for older packages but we don't do
that to avoid surprises when people are signing older packages.
|
|
|
|
|
| |
Currently all callers are supplying them but we'll want to get rid
of especially MD5 eventually.
|
|
|
|
|
|
| |
There's no point comparing the weaker MD5 for equivalence when we
can determine it by looking at a stronger digest already. Also we
don't need the digest lengths here since SHA1 is ascii anyway.
|
| |
|
|
|
|
|
|
|
| |
Mostly achieved by replacing custom parser with the parseRCPOT().
Closes: https://github.com/rpm-software-management/rpm/issues/167
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This too is quite a fundamental change for macros: up to now, arguments
to parametric macros have not been expanded. It doesn't sound so bad
until you consider something like the case in RhBug:1397209:
%global rev 133
...
%setup %{?rev:-c}
%autosetup %{?rev:-c}
One would expect %setup and %autosetup behave the same when you replace
one with the other, but no. %setup gets "called" with -c, %autosetup
does not. Instead %autosetup receives a completely useless, literal
"%{?rev:-c}" as its argument. That's just brain-meltingly non-sensical.
This certainly has the potential to break advanced macro constructs,
but OTOH what breaks might well be only written that way in order to
work around the former behavior.
There are some funny subtleties involved as the argument expansion
must occur in the callers scope, ie before we create any of the
automatic macros. For example, Fedora's font packages break if only
this or the macro scope visibility enforcement is applied but start
working again once both are present.
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a parametric macro "calls" another parametric macro with fewer
arguments than it received, the inner macro would see the %<n>
macros of the outer call which is an obvious scoping violation
and quirky behavior, making macro writing harder than it needs be.
Similar scoping issues exist for manually defined macros but those
have further complications (because of %undefine semantics) that we
sheepishly avoid here by limiting the visibility enforcing to automatic
macros only (for now at least).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changes the macro scoping rules quite fundamentally: macro
definitions are local to the parametric macro they were defined in,
and everything else is global. Among other things, this makes this
common spec idiom (RhBug:552944, RhBug:551971 etc) behave
deterministically because "foo" is placed into global scope:
%{?!foo: %define foo bar}
In theory it's certainly possible that this breaks somebodys carefully
crafted advanced macros but it seems quite unlikely, considering how
broken the alleged block-scoping has been. OTOH for macros defined
within parametric macros, nothing actually changes as that scoping has
always been enforced by rpm. The non-global define tracking is also
no longer needed for emitting warnings, because the case where it
was needed simply no longer exists.
Note that macro recursion depth is a different thing and still needs
to be tracked separately.
|
|
|
|
|
|
| |
Since we actually setup all the same automatic macros whether there
are arguments or not, doing it centrally only makes sense. Shuffle
things around a bit in preparation for the next steps.
|
|
|
|
|
|
|
|
|
|
|
| |
In some testcases we extract the BuildID with the file command.
Unfortunately the file command output changed slightly between versions.
Make the sed regexp more strict by only matching a hex-string.
Also properly "escape" [ and ] which inside an AT_CHECK should be [[ and ]].
Tested against file versions 5.11, 5.29 and 5.30.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
|
|
| |
Commit bbfe1f8 (Add build-id links to rpm for all ELF files) and
Commit 5ef1166 (Make it possible to have unique build-ids across build
versions/releases)
Introduced new test spec files (hello-r2.spec, hello2cp.spec and
hello2ln.spec). Make sure they are added to EXTRA_DIST so the testcases
pass again with make distcheck.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|