summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Parse signer keyid as part of siginfo struct parsingPanu Matilainen2017-03-283-7/+4
| | | | | Doesn't really change anything as such but seems saner this way and also makes the keyid more readily available.
* Drop long since dead stubs.cPanu Matilainen2017-03-241-18/+0
| | | | | This hasn't been built since commit 41d0a9fd3e8615efbb333746dfd2ea1ad9e285e3 almost ten years ago, just maybe we can actually drop it too...
* Actually test for __progname tooPanu Matilainen2017-03-242-3/+10
| | | | | Hopefully resurrecting whatever got broken by the round of changes surrounding this, __progname is not an entirely glibc/linux thing.
* Determine setprogname() availability by actually testing for itPanu Matilainen2017-03-242-9/+2
| | | | | | 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.
* Drop local implementation of xsetprogname/xgetprognameGleb Fotengauer-Malinovskiy2017-03-244-51/+2
| | | | | | | 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>
* Eliminate warning from '_' being redefined in sepdebugcrcfix.cPanu Matilainen2017-03-241-0/+2
| | | | | Exposed by commit cf6c87997f199b7681934b5d7c524bfff178b848 which includes system.h which includes the NLS stuff.
* Include system.h in ima and syslog pluginsGleb Fotengauer-Malinovskiy2017-03-242-0/+4
| | | | | | | | | | | | 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>
* Fix Large File Support (LFS) in sepdebugcrcfix tool and systemd_inhibit.so ↵Gleb Fotengauer-Malinovskiy2017-03-242-0/+5
| | | | | | | | | | 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>
* Only build bundled fts if system has a bad version that doesn't handle LFSGleb Fotengauer-Malinovskiy2017-03-243-2/+22
| | | | | | | | | | | | | | | | 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]
* Rename fts.h header to rpmfts.hGleb Fotengauer-Malinovskiy2017-03-244-4/+4
| | | | | | Make sure local fts.h is never included by mistake instead of system one. Signed-off-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
* build/files.c (generateBuildIDs): Fix small memory leak.Mark Wielaard2017-03-241-0/+2
| | | | | | | mainiddir and debugiddir are allocated through rpmGetPath () and should be released when done. Signed-off-by: Mark Wielaard <mark@klomp.org>
* Add a simple testcase for "rpmbuild --short-circuit -bl"Panu Matilainen2017-03-241-0/+16
| | | | | | 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...
* Unbreak short-circuited binary buildsPanu Matilainen2017-03-241-20/+51
| | | | | | | | | | | | | | | | | | | | | | 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>
* debugedit: Fix off-by-one adding DW_FORM_string replacement slashes.Mark Wielaard2017-03-221-4/+8
| | | | | | | | | | | | | | | | 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>
* Add armv5tl supportNeal Gompa2017-03-222-5/+10
|
* tests/rpmbuildid.at: Make file sed regexp more strict to extract BuildID.Mark Wielaard2017-03-211-22/+22
| | | | | | | | | 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>
* Make sure to reset file attributes for generated build-id directories.Mark Wielaard2017-03-215-0/+94
| | | | | | | | | | | | | | | | [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>
* debugedit: Fix edit_dwarf2_line replace_dirs -> replace_files typo.Mark Wielaard2017-03-211-1/+1
| | | | | | | | | | | | 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: Fix cross-endian build-id reading and updating section data.Mark Wielaard2017-03-211-32/+31
| | | | | | | | | | | | | | | | | | 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>
* build/files.c (processPackageFiles): Don't call generateBuildIDs for noarch.Mark Wielaard2017-03-211-4/+8
| | | | | | | | | | | 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>
* build/files.c: Only check build-ids for executable files in the main package.Mark Wielaard2017-03-211-5/+14
| | | | | | | | | | | | | 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>
* Rename internal argument for clarityPanu Matilainen2017-03-212-7/+7
| | | | | | | | | 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.
* Add workaround for old binutils versionsMichael Schroeder2017-03-201-2/+2
| | | | | readelf used to append a bogus tab to the --debug-dump=info output. Add a sed call to get rid of it.
* Add file disposition FA_TOUCHPavlina Moravcova Varekova2017-03-172-3/+12
| | | | Installation of FA_TOUCH item only upgrades its metadata.
* Rebuild buggy hello-2.0.1 test packagesPanu Matilainen2017-03-162-0/+0
| | | | | | | | | | | 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.
* Rebuild buggy hello-2.0.1 test packagesPanu Matilainen2017-03-162-0/+0
| | | | | | | 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
* parseSpec: use getline instead of fgetcGleb Fotengauer-Malinovskiy2017-03-151-17/+2
| | | | | | | | 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>
* perl.req: Also skip blocks with my var = <<Florian Festi2017-03-131-2/+2
| | | | | | | | | | | | | | | Before only var = <<BLOCK foo BLOCK was skipped. But my var = <<BLOCK is also valid perl and needs to be skipped for dependency scanning.
* Plugins may contain translatable messages tooPanu Matilainen2017-03-101-0/+5
|
* Oops, remove leftover includesPanu Matilainen2017-03-101-4/+0
| | | | Should've been in commit 86c523da6fa1cada0c5753c14bb1f2fdd436d28d
* Move scriptlet priority reset to a pluginPanu Matilainen2017-03-104-26/+55
| | | | | | | | | | | | 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.
* build/files.c: Unset __debug_package implies missing build-ids aren't fatal.Mark Wielaard2017-03-101-1/+5
| | | | | | | | 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>
* generateBuildIDs: Fix error handling.Mark Wielaard2017-03-101-7/+11
| | | | | | | | | | | | | 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>
* Re-enable rich dependecies for build requires and conflictsFlorian Festi2017-03-091-0/+2
|
* Fix check whether to allow rich deps in a given tagFlorian Festi2017-03-091-4/+6
| | | | Broken with 9d5bbd9774d00f50749bb045217eaf91c87b6de0
* generateBuildIDs: Don't warn or error for object files without build-id.Mark Wielaard2017-03-091-4/+11
| | | | | | | | 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>
* Doh, remember to move the default comment to SHA256 tooPanu Matilainen2017-03-091-2/+2
| | | | Should've been in commit 0cd74ade37d16d282d13e781deb68a219b2c04b9
* Add a VSF control bit to disable payload digest verificationPanu Matilainen2017-03-082-1/+5
| | | | | | | | | 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.
* Bump file digests to SHA256 by default, finallyPanu Matilainen2017-03-081-5/+5
| | | | | | | | | 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.
* Implement SHA256 header digest, creation + verificationPanu Matilainen2017-03-0810-11/+62
| | | | | | | | | | | 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.
* Make SHA1 and MD5 optional in rpmGenerateSignature()Panu Matilainen2017-03-081-12/+16
| | | | | Currently all callers are supplying them but we'll want to get rid of especially MD5 eventually.
* Remove redundant comparison of the weaker digestPanu Matilainen2017-03-081-11/+3
| | | | | | 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.
* Switch signing code to use the new ID-based digest APIPanu Matilainen2017-03-081-4/+4
|
* add support for rich dependencies from dependency generatorsIgor Gnatenko2017-03-086-71/+54
| | | | | | | 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>
* Expand parametric macro arguments before processing (#127, RhBug:1397209)Panu Matilainen2017-03-071-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Enforce visibility scoping for automatic macrosPanu Matilainen2017-03-072-3/+22
| | | | | | | | | | | | 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).
* Change macro scoping to be global / local to parametric macrosPanu Matilainen2017-03-071-19/+20
| | | | | | | | | | | | | | | | | | | | | 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.
* Consolidate all macro argument setup to grabArgs()Panu Matilainen2017-03-071-15/+15
| | | | | | 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.
* tests/tpmbuild.at: Make file sed regexp more strict to extract BuildID.Mark Wielaard2017-03-061-10/+10
| | | | | | | | | | | 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>
* Include new test data spec files in EXTRA_DIST.Mark Wielaard2017-03-061-0/+3
| | | | | | | | | | | 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>