commit 13b4521341781293c41ac898aa9c2d2f6bc1f21d
Author: Michal Domonkos <mdomonko@redhat.com>
Date:   Mon Feb 5 14:42:49 2024 +0100

    Preparing for rpm 4.19.1.1

commit ab3ec5583a0039bd86ea4a0f05ce5a9c82a00236
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Tue Jan 30 15:08:34 2024 +0200

    Fix couple of leaks in rpmpgppubkeyfingerprint test prog
    
    Tracking the test-programs themselves is kinda silly but since it
    could reveal leaks from librpm side, we better pay attention.
    These could do with a goto exit-refactoring.
    
    (cherry picked from commit 5f5fa88521791052592e12d7f671722b8cc81ac8)

commit 368d82e0b26685384b96097eac5049420119d6f8
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Tue Jan 30 15:04:03 2024 +0200

    Tip-toe around rpmfiFN() thin ice in fsm
    
    Any pointer gotten from rpmfiFN() is only valid until the next
    rpmfiFN() call, and here the path can end up inside plugins which
    may have their own reasons for calling rpmfiFN(). At which point
    the dest we passed would be invalid. strdup() it to appease ASAN,
    but this needs a saner solution really.
    
    (cherry picked from commit 7bf818c8344ecbf0e14a26e6393582ae79df864e)

commit 5976558efe7228e4351f68560ac8d8bf16846ea0
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Tue Jan 30 15:01:55 2024 +0200

    Fix a bunch of argv leaks in the Lua extension
    
    (cherry picked from commit 04b3317e619d4efd8f86275904e1af00b40ffb6b)

commit 054371607aa620220c4c64843b70d6ee565f4396
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Tue Jan 30 14:55:54 2024 +0200

    Fix spec parser leaks from %*trans -f <file>
    
    The untrans-versions leak because grepping around didn't turn up
    the trans-counterparts ... because they didn't exist either.
    Those leaks are adults by now.
    
    (cherry picked from commit 26a1323022e3153d99b2f1095fe040f52fb2e3f3)

commit 2ec4f84c16694413d9223544d172ba8fff5ca054
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Wed Jan 31 10:09:07 2024 +0200

    Add a note about rpmfiFN()/rpmfiOFN() pointer validity to API docs
    
    (cherry picked from commit 4b656321d6a735d4ac5d299ea6b977d6bf3c68f7)

commit 8e5f8ab2141f44e3442087aa7af41a444ae16ddc
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Wed Jan 24 12:44:34 2024 +0200

    Fix a theoretical use of uninitialized struct members
    
    If rpmScriptFromTriggerTag() was called with tm other than the three
    handled cases in the switch, the rpmtd_s structs would be uninitialized
    and weird things could happen. The value of tm is hardwired in all the
    existing callers AFAICS but the extra safety doesn't hurt either.
    
    Discovered by static analysis in RHEL.
    
    (cherry picked from commit 656fe42af1d497c35769c740fcc98950e1455bad)

commit 494e104c40491dcd435fd7d16ea16a6e6a56ba99
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Wed Jan 24 12:03:39 2024 +0200

    Use unsigned integers for buildtime too for Y2K38 safety
    
    This little patch buys us 68 extra years to move to 64bit time tags
    in rpm. That seems achievable.
    
    Fixes: #1228
    (cherry picked from commit 97aa64d8281974fb369c66d5aef8650515b89c52)

commit 8a6e59a8b1b9670cebd6058ac56f85c91f803f1f
Author: Takuya Wakazono <pastalian46@gmail.com>
Date:   Thu Jan 18 18:41:11 2024 +0900

    Don't use _nl_msg_cat_cntr if it's not available
    
    musl doesn't need to use libintl from GNU gettext because it has its
    own NLS implementation. Assuming _nl_msg_cat_cntr exists breaks the
    build against the musl system.
    
    (cherry picked from commit f401979a4c4829d68e9614860644bdb74b6dda66)

commit ac42433e0f57a0d8ac05f471eb0880c687a85ed6
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Tue Jan 16 15:46:57 2024 +0200

    Simplify the cache lookup logic, no functional changes
    
    (cherry picked from commit 593059db0fe7e63163254d3b7c25cc641dbd44cb)

commit ac155918ef257f0ed2355c6e8b9378ef040ca689
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Tue Jan 16 15:05:34 2024 +0200

    Make user/group lookup caching minimally thread-safe
    
    Now with the caching data in a single struct from the previous commit,
    we can easily make this per-thread for a minimal fix for thread-safety.
    
    Fixes: #2826
    (cherry picked from commit c86f0888dd7572afb5b7abe673199423ff1940aa)

commit 6ef8541ac48e742a100857d72c486a632dd9d458
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Mon Jan 15 12:30:58 2024 +0200

    Centralize user/group lookup caching into a single data structure
    
    Collect all the cached data into a struct for sanity.
    It's worth noting that this also simplifies the caching, we no longer
    keep separate name to id and id to name caches (totaling four).
    We simply cache one id/name for for user and another for group data.
    Also, reset ids to 0 rather than -1, this is far more obviously a safe
    value as we have special cases to handle id 0.
    
    rpmugUname() and rpmugGname() are have no users in the current codebase,
    so this was developed wrt commit c576d96930bfaf8f4328170de4c2915e76c1f715
    where they still are used, to avoid nasty surprises later on if somebody
    finds a new case for these.
    
    (cherry picked from commit 309db68b33eebae38d1247374f63c0f7f2883594)

commit ec079d5337047d92b13901fb6a2cac692352aa5d
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Tue Jan 16 14:59:08 2024 +0200

    Remember to free user/group cache on librpm shutdown (again)
    
    I think this was here previously but has gotten erreonously removed
    at some point - we do use rpmug from librpm so we need to free it too.
    
    (cherry picked from commit dec8bcc6757b095f1682fd9cfc1dbd338aabaf49)

commit 40a95b23fa7d181ecbdd42b957026e1f75c0486e
Author: Alexander Kanavin <alex@linutronix.de>
Date:   Tue Jan 16 13:43:36 2024 +0100

    CMakeLists.txt: restore readline support as an explicit option
    
    This was lost in autotools -> cmake transition. The particular
    reason to make it explicit is that readline is gpl version 3
    licensed, and in some builds components under that license
    need to be excluded.
    
    (backported from commit b2e8a2bed582a9ccc70fbbf3c8586bdd712ea4d1)

commit b83c5601dec76cd8dfab0567111957db6182743b
Author: Matteo Croce <teknoraver@meta.com>
Date:   Mon Jan 15 08:27:17 2024 -0500

    Don't attempt to install html pages if they're not built
    
    When building from git on a system without Doxygen, html pages are not
    built and the install fails with:
    
            Install the project...
            -- Install configuration: ""
            CMake Error at docs/cmake_install.cmake:51 (file):
              file INSTALL cannot find "/html": No such file or directory.
            Call Stack (most recent call first):
              cmake_install.cmake:47 (include)
    
    Conditionally install html docs only if we build them.
    
    (cherry picked from commit 6098fe1e9f735ab3a603eb429e01300ae48bf4fe)

commit f274d74778bcb486db24c8f077b40c0d266daf8b
Author: Matteo Croce <teknoraver@meta.com>
Date:   Fri Jan 5 21:39:03 2024 +0100

    Add missing include
    
    The build fails because of a missing include in cmake:
    
        CMake Error at CMakeLists.txt:353 (check_symbol_exists):
          Unknown CMake command "check_symbol_exists".
    
    Include the needed file to fix the issue.
    
    (cherry picked from commit 2300eb6e064473b148474486e2ffd2106f8bab86)

commit 7d0a7c27d132ed0abb4b2bc414b822c84b7dce44
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Thu Jan 4 11:26:03 2024 +0200

    rpmcli.h forces a public dependency on popt includes
    
    This is mildly annoying, librpm users don't need to link to popt but
    this one include in rpmcli.h (that most API users wont even use) forces
    a public dependency on it.
    
    Another possibility could be splitting out the "cli" part of librpm
    one way or another, but that doesn't seem worth all the trouble it would
    be.
    
    (cherry picked from commit 75965c1e712b000763df922223fa1a2db284fc03)

commit 25972feebff18b1215eea5e77c685e51fc9b1eee
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Thu Jan 4 11:25:10 2024 +0200

    Drop unnecessary rpmcli.h include from rpmbuild.h
    
    (cherry picked from commit dbd5307bdf3ef82ec1fa49e36fb10a3b8bdc98bb)

commit 0d443fb2feca454229b36a00347f2c5dee6502fe
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Wed Dec 20 09:44:45 2023 +0200

    Fix libintl linkage and include directories (cmake transition fallout)
    
    We checked for libintl in the top-level CMakeLists.txt but then never
    used it for anything. This only ever worked on glibc where this all
    is bundled in. Unfortunately Intl only becomes an importable target
    in cmake >= 3.20 which is too new for us to rely on for now.
    
    Python bindings are omitted here because we don't have any translated
    messages in there. Whether we should is another topic.
    
    (backported from commit a77c1d0670e3563af3c4ce3e9dd53879d76acb9b)

commit 3b4ee84da47ab788cba13ebf78e1b3fb3025f4ac
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Wed Dec 20 09:38:09 2023 +0200

    Cosmetics: fix rpmio cmake indentation style
    
    (cherry picked from commit 6e507ddd9cb8a6ce5c6e6604cd6e7d4b1c4bc8f7)

commit b8d6fe3c68de4255b3cfb6c154287bb40f116e4b
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Tue Dec 19 10:44:01 2023 +0200

    Conditionalize libdw and libelf linkage to librpmbuild
    
    I clearly remember testing the behavior wrt these and concluding that the
    cmake exported interface syntax doesn't require conditionalizing.
    Clearly it does though, so dunno what I was supposed to have tested
    back then.
    
    Suggested-by: Mark Dascher <mark@papertrail.com>
    (cherry picked from commit d6736bdc81f2f089edac3a7fc8dc414639780edd)

commit dbf745cc9b478cb432c5c5cf3467461d5e8ce45a
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Tue Dec 19 10:29:51 2023 +0200

    Fix missing private linkage to iconv and popt in librpmbuild and sign
    
    Yet more rather obvious fallout from the cmake transition. It's strange
    these don't fail the build on Linux.
    
    Suggested-by: Mark Dascher <mark@papertrail.com>
    (cherry picked from commit 513595cdf0b45ab5096e91415c0591f3d39d4d98)

commit 51614425548deafa437205fc222809ba91b00573
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Tue Dec 19 10:24:34 2023 +0200

    Fix rpm2archive build regression due to missing libgen.h include
    
    Should've been in commit 04d49fbd2f3f470669dccfba0a4f2264509a4513
    where basename() usage was introduced.
    
    And because the standard version of basename() has non-const argument,
    we run into rpm2archive using non-standard const argument to main(),
    because popt got it wrong. Move the const-cast to the popt invocation
    for consistency with the other codebase.
    
    Suggested-by: Mark Dascher <mark@papertrail.com>
    (cherry picked from commit 4e171567cedb247177ef25b767850057088b655c)

commit f2d78c6d606a105528b05111d3e24ebb6877bf65
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Mon Dec 18 12:25:04 2023 +0200

    Fix unconditional dependency on non-POSIX GLOB_ONLYDIR flag
    
    This regressed when we axed our internal glob copy in commit
    66fa46c006bae0f28d93238b8f7f1c923645eee5. Luckily GLOB_ONLYDIR is only
    an optimization so we can just skip it if not available.
    
    (cherry picked from commit 57f3711846f44da0f37cbc5dd66e8fba80a3bee1)

commit 9b02bb1b673537d480d774a0fe989b7d634f64af
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Tue Dec 12 16:49:27 2023 +0200

    Fix hard dependency on strchrnul() GNU extension
    
    We missed the use of this non-standard function on review. rpmsort
    needs to be fixed to not rely on GNU extensions but in the meanwhile
    we need to check for that function and disable if not present.
    
    (backported from commit 5f74110974ff3bcdd058c13c605bfbf6d4a1e586)

commit dbd4f8f03d8b66b6af541078f0195107eff1c402
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Tue Dec 12 16:42:42 2023 +0200

    Fix hard dependency on libelf (cmake transition fallout)
    
    Conditionalize elfdeps build on libelf availability.
    
    (cherry picked from commit 8758fff7f7ac6f491f8b2980b6bc2370e46a4ac4)

commit 1da87856df1995b8a3bb533f9039e51e9810c568
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Fri Dec 15 13:15:29 2023 +0200

    Fix regression in Lua scriptlet runaway child detection
    
    Commit a8107659ef3dd4855729bf65aa4d70f784cb5a5f moved the detection
    to parent using waitpid(), but this causes it to complain on any
    process in the same process group. In the usual rpm context we don't
    have any, but we can't very well tell API users not to have any
    children. And then failed to detect a runaway Lua child in one of
    our own tests. Uff.
    
    rpmlog() in the child has the issues mentioned in the originating
    commit, but that's a problem that needs to be solved elsewhere.
    Revert back to issuing a warning when we actually *are* in the child
    process, so there are no false positive possible. Use EXIT_FAILURE
    like in the original version, dunno why I'd changed that.
    
    Update the rpmlua test to expect the deserved warning, and use
    stdio for printing its "normal" output, the catch there is that we
    need to flush the io in the child.
    
    Reported at https://bugzilla.redhat.com/show_bug.cgi?id=2254463
    
    (cherry picked from commit bb4aaaa2e8e4bdfc02f9d98ab2982074051c4eb2)

commit 79d56121e86b52f2f652fdd37203be8862208645
Author: Florian Festi <ffesti@redhat.com>
Date:   Wed Dec 13 11:58:01 2023 +0100

    Fix markdown formatting in man page
    
    (cherry picked from commit 195b5cd3c7138495dea29c501159372e8410eb1f)

commit 9f64db92a689897eeca26cfa06a4c8f47ae59467
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Wed Dec 13 11:57:50 2023 +0200

    Don't warn about missing user/group on skipped files
    
    There's no reason to complain about missing user/group for entities
    we don't create at all. It's cosmetical only, but "regressed" in the
    4.17 fsm robustness rewrite.
    
    Reported in https://issues.redhat.com/browse/RHEL-18037
    
    (cherry picked from commit 6c66abd34cccbb5b3c063f8f613e0c2faffc415f)

commit 98b301ebb44fb5cabb56fc24bc3aaa437c47c038
Author: Michal Domonkos <mdomonko@redhat.com>
Date:   Tue Dec 12 11:40:33 2023 +0100

    Preparing for rpm 4.19.1

commit 4eb72997ef06cbc44bc24a2f6352532539f173ec
Author: Florian Festi <ffesti@redhat.com>
Date:   Mon Dec 11 15:50:15 2023 +0100

    Print full path if file removal fails
    
    For normal debug output the basename of the files are sufficient as when
    debugging is enabled the directories are also printed. But here the
    warning is given without a debug flag so we need the full context right
    there.
    
    (cherry picked from commit dcf8c5abc64eb0fe3c81482008b8a13bec19eb20)

commit 5dfb9877dd2b433879c0a2e57608c05aac5da029
Author: Frank Dana <ferdnyc@gmail.com>
Date:   Tue Oct 31 11:31:39 2023 -0400

    docs/macros.md: Fix expansion shorthand
    
    (cherry picked from commit f4ad03dc2a62de1f182fc4c7841784a35bc6ae22)

commit f9873aed0a2e871d11d7ce740380b7bc8347ec1f
Author: Michal Domonkos <mdomonko@redhat.com>
Date:   Thu Dec 7 17:21:04 2023 +0100

    Refactor cmake config for man pages
    
    No functional changes, just reduces verbosity a bit.
    
    (cherry picked from commit 014b09de6fd0e4a295b0e751f2ef30eaa7c1aa04)

commit 4b5c47236b0a34fe33cd3d484f1ad745f2c7fe93
Author: Michal Domonkos <mdomonko@redhat.com>
Date:   Thu Dec 7 17:19:35 2023 +0100

    Build all manuals regardless of enabled features
    
    Commit 1870f4df16d9f20e5a5341ea000c5b8aa19a2d21 stopped the installation
    of man pages for disabled features.  We were still building them all,
    though, so they appeared in dist tarballs as they should have.
    
    This was lost in the cmake translation where the opposite problem was
    introduced: only man pages for enabled features are now built, meaning
    that when preparing a tarball, you need to make sure all the features
    are enabled in your build in order to have all the man pages pre-built
    and bundled.
    
    Fix this "regression" by building all man pages unconditionally again
    while only installing those that are enabled.
    
    (backported from commit ddc0ad85a58a9f678cfd26fa7c6246ff314ff2ff)

commit 234b34d918839a70771ec57ef3b01e29fd069c46
Author: Michal Domonkos <mdomonko@redhat.com>
Date:   Tue Dec 5 11:03:47 2023 +0100

    Don't include git refs in ChangeLog
    
    Right now, we "leak" any local branch or tag names into the ChangeLog
    which is unnecessary (e.g. "experiment-foo-123") and also just pollutes
    the diff when comparing ChangeLogs between releases.  Only show the
    plain log.
    
    Fixes: #2647
    (cherry picked from commit 017b5a4141e1143fc43acf276bdc6bfb6c1eb91a)

commit 77d3529c31ca090a40b8d3959a0bcdd721a556d6
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Thu Nov 30 13:33:46 2023 +0200

    Never use current user info or file ownership during build
    
    There's no situation where rpmbuild should use uid/gid from either
    the filesystem or current user. The former made sense in the
    pre-historic times before Buildroot was a thing, but in the last 20+
    years that's always the wrong thing to do. Always. The only user/group
    info rpm can legitimately use is the one that is explicitly specified in
    the packaging, and otherwise fallback to root/equivalent.
    
    Besides fixing a long-standing annoyance with src.rpm file ownership,
    this also fixes a regression in 4.19.0 where a non-local or otherwise
    unresolvable user info could cause a segfault during rpmbuild (RhBug:2248763).
    
    Fixes: #2604
    (backported from commit a0553eb38a01772254cd48fef7ad116294cf801a)

commit d146585a7e064edb67ca0f4f354f3bfb67400c9b
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Fri Dec 1 14:26:50 2023 +0200

    Bumb CI to Fedora 39
    
    No particular reason this time, but nice to be on the same page with
    the system rpm.
    
    (cherry picked from commit c576d96930bfaf8f4328170de4c2915e76c1f715)

commit 6fd08587514f3b3c903ad195f4834d8756b679a9
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Fri Dec 1 13:41:17 2023 +0200

    Optimize Doxygen output for C
    
    This simply uses terminology better suited for C, such as "data
    structures" instead of "classes" and so on.
    
    (cherry picked from commit 15bd653a5be4fdb60269c2a712c0049bddccd600)

commit 993191a89d85514ca8a3e5570047f012b7b8420c
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Fri Dec 1 13:30:14 2023 +0200

    Honor ENABLE_WERROR on Doxygen too
    
    (cherry picked from commit 5d7a192c9279ac24e57d443e417a8fb7ecffc012)

commit b1207ee9933c25c8e45d0350c873cde9d7b4a15f
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Fri Dec 1 13:26:17 2023 +0200

    Silence not-documented warnings from Doxygen
    
    These litter our build logs with redundant noise from undocumented
    macros and typedefs that aren't really worth the trouble to document.
    Sadly Doxygen doesn't have fine-grained controls for emitted warnings.
    
    (cherry picked from commit c47ee2435fa673c32103c7e3dda380de1641d3ab)

commit 11daac6757abecd9f01246e11c822afd96d861fd
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Fri Dec 1 13:19:48 2023 +0200

    Fix a bunch of undocumented-warnings from Doxygen
    
    No functional changes, just docs.
    
    (backported from commit 06ea60361f12251664187b0d1dd80848ba92d352)

commit 5d3f82a7596a48aab05356623f67cdc69bdaed4f
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Fri Dec 1 11:23:40 2023 +0200

    Drop autoconf-era leftover Doxygen config
    
    (cherry picked from commit 3ffa334a990c0a431ea33ded839b8dd82a93a786)

commit 135f94955e8f7d9b61584f0dc72960c241ec6797
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Wed Nov 29 13:18:33 2023 +0200

    Clarify pgpParsePkts() and pgpReadPkts() API docs
    
    Both process exactly one ASCII-armored block, this wasn't clear in
    the docs.
    
    Fixes: #2387
    (cherry picked from commit bccf58f0d414a90fe2aca736255f126ad2bf45b2)

commit ca6236cf7bcba1f44c4924dc47d74adfdc964f43
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Thu Nov 16 14:22:15 2023 +0200

    Fix integer overflow in memory calculations on 32bit systems
    
    "long int" on at least x86 Linux is exactly the same as a plain "int",
    so calculations can easily overflow. 32bit systems are not expected to
    have hundreds of gigabytes of memory but a 32bit process on a x86_64 can
    run into all sorts of funny things, such having 500GB system memory. At
    which point the type capable of addressing all of process memory is
    absolutely useless for calculating the total memory.
    
    Use uint64_t in the memory calculations to make the size explicit. Of course
    one day we may cross that border too, but I hope to be retired by then.
    
    Fixes https://issues.redhat.com/browse/RHEL-16557
    
    (cherry picked from commit 1cd9f9077a2829c363a198e5af56c8a56c6bc346)

commit 5ab960e9feea3c29565917a7e1fc3108129c4a0d
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Mon Nov 27 14:32:42 2023 +0200

    Avoid compiler complaints from Transmeta Crusoe detection on x86 builds
    
    Multi-character character constants are implementation defined, and
    while it MAY be reliable enough on i386 gcc, even that produces a
    warning. I don't have a test-Robinson here so rather than risk a
    conversion to string comparison like the other is_arch() tests are,
    just write out the integer and leave the character constant as a
    reference comment.
    
    (cherry picked from commit d0e03b21cabfcd090e70620f3e19227e6519f1c3)

commit 0d38b67ce31b471d0e1e51c383b96b6e72ef38f4
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Mon Nov 27 13:42:30 2023 +0200

    Fix a bunch of integer size mismatch warnings on 32bit builds
    
    (cherry picked from commit 54a79a19c4ff82a0874588ebe24fce21462f7926)

commit f615aa118f33f3ad437b9a236009d175a9b0f106
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Mon Nov 27 11:52:34 2023 +0200

    Emit full paths for file disposition diagnostics on --fsmdebug
    
    The full path is visible in the actual file operations later, but the
    pre-flight disposition diagnostics is unreadable without the full path.
    This regressed in the switch to relative paths for the *at() API family
    for the symlink CVE fixes.
    
    (cherry picked from commit c140768202e271b60910644c1e4bf848a50218d3)

commit 27afe5f0b036c16649b33ee4f3c98bc19ba0000d
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Mon Nov 20 10:43:16 2023 +0200

    Add support for retrieving %generate_buildrequires section from the spec
    
    Should've been in commit 58dcfddc376a7c97de1432f0082be0d5f01adbcd
    
    (cherry picked from commit c359a5cd354ae963175091c8e6ed2bde918771a2)

commit a9eacf9285b875a4e62fc26a09857835b590ce88
Author: Michal Domonkos <mdomonko@redhat.com>
Date:   Fri Nov 17 12:16:48 2023 +0100

    Extend test README
    
    Fixes: #2611
    (cherry picked from commit 949f2819749ddb8854162bf544d83a1a1402291c)

commit 78a9bd120b1ce809ac8a4daf2ec91fb439d1fc21
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Thu Nov 16 11:19:14 2023 +0200

    Fix segfault on %{?getncpus}, regression in 4.19.x
    
    Commit deaebd0c89a6d453bb971fd8f5a3b858e7a95733 assumed there would
    always be args, but in the macro existence test none are set up.
    
    Reported as a side-issue in https://issues.redhat.com/browse/RHEL-16557
    
    (cherry picked from commit c110ad11c33aeb0fe9ef1d494d689b59e47e855e)

commit d8cc2775f07c0f4365ec29937e221fcd09a52ea4
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Wed Nov 15 14:44:42 2023 +0200

    Document pgpPrtParamsSubkeys() returning only signing-capable keys
    
    Since commit a9cca032a2b7c0c6bcacc6ab4ecd25c95cc75305 we've only
    returned signing capable subkeys, but this has seemed like an
    implementation detail. Make it explicit.
    
    Fixes: #2515
    (cherry picked from commit 01fb42d42ca710bf24e3af841d43b4e3d60b3aef)

commit 217caa46e1aad597a870b0abb8371b26ff7d6176
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Wed Nov 15 09:24:28 2023 +0200

    Fix %{getncpus proc/thread} potentially returning zero
    
    Add the missing sanity check/fixup for memory starved systems where
    we end up returning zero cpus. Should've been in commit
    deaebd0c89a6d453bb971fd8f5a3b858e7a95733 originally.
    
    Reported in https://issues.redhat.com/browse/RHEL-16557
    
    (cherry picked from commit 6714ec7068a0343dcb4aaaeb4fe49940c129292f)

commit 6dd356915f2163686794e4c1779abe4eac72d9db
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Tue Nov 14 11:59:18 2023 +0200

    Add a test-case for invalid intermediate symlink owner (CVE-2021-35939)
    
    This should've been in commit 96ec957e281220f8e137a2d5eb23b83a6377d556
    but back then we didn't have a good way to test ownership matters.
    
    (cherry picked from commit 0091214d2f2b489f4d38464c8d217cd7f5aba50a)

commit 406a1beee0b60a33ef2078116b4a749adcda157c
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Tue Nov 14 11:37:48 2023 +0200

    Fix wrong return code on O_DIRECTORY open of invalid symlink
    
    The dir argument to fsmOpenpath() is supposed to be a rough O_DIRECTORY
    equivalent, and if the path is actually a misowned symlink it should
    return ENOTDIR instead of ELOOP. Makes the resulting error messages
    at least a little more comprehensible.
    
    (cherry picked from commit 89ce4e7ca592f5abafc3f25aeaa07d36a7b43a61)

commit 40eda139494886f707d5827774b478fea8db0eec
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Tue Nov 14 09:07:28 2023 +0200

    Allow version to be omitted in the replace test spec
    
    (cherry picked from commit 2c20f9677eff989817148d236543191dec0d8059)

commit f6216e71e44f327d4f8f5a40d8312d72b1fda3f6
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Thu Nov 9 15:24:37 2023 +0200

    Refactor / cleanup rpm2archive entry fillup a bit
    
    Do all the entry fillup in the function intended for that,
    no functional changes intended. Drop the unnecessary nlink check
    from the unpacking: if there's content, it should unpacked.
    
    (cherry picked from commit 3151a187402767ab87ec91d34bb7337dee89af92)

commit a24f9ba1fbce426c75aeec911dc808d646599e1f
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Thu Nov 9 15:18:55 2023 +0200

    Document rpm2cpio as obsolete, add pointer to rpm2archive.
    
    (cherry picked from commit f6b47609a963a6cf2d3181a0bb90437c330d401f)

commit ee9314b09a69c56de9247a1a6d3d40c71ada5fdd
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Thu Nov 9 10:30:46 2023 +0200

    Add cpio format support to rpm2archive
    
    cpio is a legacy format but content in that format will remain with us
    for a very, very, very long time still. Better support the format here
    than have to support a separate tool just for the purpose.
    
    The "new ascii cpio" format can't host files larger than 4GB, but
    most rpm content fits and will continue to do so in that range easily,
    so instead of just outlawing the good 'ole format, just skip over
    anything we can't handle and emit a warning.
    
    Additionally, if invoked as "rpm2cpio", behave like it: no compression,
    cpio format.
    
    (cherry picked from commit 04d49fbd2f3f470669dccfba0a4f2264509a4513)

commit db1996e4e982d86531714373e17fc8df059615d7
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Thu Nov 9 13:45:14 2023 +0200

    Fix uid, gid and nlinks not getting populated by rpm2archive
    
    Take advantage of rpmfiStat() and archive_entry_copy_stat() which
    handle most of the dirty work here. Hardlink sizes are special because
    in archives, the file size is 0 except for the one with the content,
    but otherwise of course hardlinked files have sizes as usual.
    
    (cherry picked from commit b86f6ad4f0c557f64ffbb53dbb90e4f2d9f85a7c)

commit 9829e88af044f45398302b683b45b454bf526c39
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Thu Nov 9 10:46:48 2023 +0200

    At least try to handle write errors in rpm2archive
    
    (cherry picked from commit fa1fbe95ed12ea7dd916cc277ac2cb227d7f9621)

commit 0488c494f7098313a81c8ebd4714a78605beaefa
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Thu Nov 9 13:34:06 2023 +0200

    Fix some invalid rpm2cpio invocations in the test-suite
    
    runroot is the wrong thing to use with rpm2cpio which doesn't understand
    things like --define. This has only worked because rpm2cpio is dumb
    enough not to look at its arguments at all.
    
    (cherry picked from commit 80d5fc3c9ece8861bb63001e1b76b2fa8b01afd2)

commit 56af525e6f0ca24967f18bf21f46dfdf454b24b1
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Thu Nov 9 09:57:02 2023 +0200

    Use the expected rpm2cpio-like syntax for rpm2archive tests
    
    (cherry picked from commit 243deae923065160e6aba6dbbe825de73ae74276)

commit cf4c02a0d7a0ee49d6209fb7d36bd02fe36141f6
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Thu Nov 9 09:53:30 2023 +0200

    Split the two rpm2archive tests to separate test-cases
    
    No actual change, just allows more comprehensive testing, easier to
    read and add more.
    
    (cherry picked from commit d49e26498e9861e54971a98b2442aaeeb7bfff61)

commit 35b4537b534d97e5e537833e6556608ae5477d2e
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Fri Nov 10 10:38:54 2023 +0200

    Fix sbit removal if fchmodat() doesn't support AT_SYMLINK_NOFOLLOW
    
    glibc versions prior to 2020 know about AT_SYMLINK_NOFOLLOW but don't
    actually implement it for fchmodat() and returns ENOSYS when used.
    We don't check the return code in removeSBITS() so this silently fails
    on those older versions.
    
    We already verify the thing is not a link in the fstatat() condition
    because cap_set_fileat() doesn't have any "dont follow" mode at all,
    so we can just as well drop it from the fchmodat() and make this
    work on more libc versions.
    
    Add a test for the suid bit removal while at it.
    
    (cherry picked from commit 7d3d9041af2d75c4709cf7a721daf5d1787cce14)

commit 7676d95fe09f97f584f2ce88655ab0db502ed608
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Thu Nov 9 16:08:53 2023 +0200

    Split the dependency generation test into individual checks
    
    No actual changes, just makes it much easier to read + work with.
    
    (cherry picked from commit e3ab8a9871da5acdadd13d8f62709f4b0259ba1b)

commit b2d5c289e9666ff83fd5eb232b6c969aa2d10017
Author: Dirk Müller <dirk@dmllr.de>
Date:   Thu Nov 9 13:34:15 2023 +0100

    Switch brp-compress to bash
    
    commit f3f763e54d introduced the use of 'read -d' which is
    bash specific.
    
    Signed-off-by: Dirk Müller <dirk@dmllr.de>
    (cherry picked from commit 4d219ed463984d69c532413584a4bd7b5e76e8d9)

commit 1c12a5d614926d9af8c652a856ba9168d9239485
Author: Michal Domonkos <mdomonko@redhat.com>
Date:   Tue Nov 7 16:40:36 2023 +0100

    Adapt Dockerfile.fedora to F39
    
    The fedora-repos-modular package is gone from F39.  This commit makes
    the Dockerfile work on a F39 host with the mktree.oci backend since we
    override the release with "podman build --from fedora:39 ..." there.
    
    (cherry picked from commit f851bce1ef69c047a869a3a83b1063a037bcd289)

commit 30f222c6681656313bcd2ab2f185c84ab482ebda
Author: Michal Domonkos <mdomonko@redhat.com>
Date:   Wed Nov 8 17:28:09 2023 +0100

    Allow SOURCE_DATE_EPOCH=0 again
    
    Commit 11132fc21fb01ed63c621d852bc081a914d4f021 assumed that the value
    of 0 is never used in practice and thus used it to indicate "disabled",
    however that assumption has turned out to be wrong because ostree uses
    precisely that value as mtime in inodes, which in turn breaks existing
    workflows in this space (see the associated ticket).
    
    Fix this by reverting the above commit (except leaving source_date_epoch
    initialized to 0, to prevent GCC warnings as mentioned in that commit).
    
    As to why not just initialize source_date_epoch to -1: time_t happens to
    be a signed integer on most platforms but POSIX doesn't specify its
    signed-ness.
    
    Add some accompanying tests too.
    
    Fixes: #2679
    (cherry picked from commit bb1eeb49132e2be3582f1e949a20ea5f6c8104cf)

commit 4b6f142f79560f7f4075fb0ffc843d334b3dd146
Author: Takuya Wakazono <pastalian46@gmail.com>
Date:   Wed Nov 8 01:56:56 2023 +0900

    Fix a macro in the comment
    
    Nothing defines RPMHOME, replace it with RPM_CONFIGDIR.
    
    (cherry picked from commit 17f72c4e7f872a70809128160cf1e74be9c4500c)

commit 05b97f011cab0f4576efb9e883ff73722213b2e2
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Fri Nov 3 12:15:58 2023 +0200

    Fix comment line handling in sysusers.d(8) files
    
    sysusers.d(8) format permits empty lines and commits, and so must we.
    Add some extra fluff to the test-case for this.
    
    This is the second half of
    https://bugzilla.redhat.com/show_bug.cgi?id=2246236
    
    Fixes: #2741
    (cherry picked from commit a8ec768950f0adb9fb0c264596350fc929437ac8)

commit 5addad402cc360df4f0681b9ffdcec09e5f78788
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Fri Nov 3 11:53:11 2023 +0200

    Handle unsupported 'r' and 'm' sysusers types more gracefully
    
    People will want to use existing sysusers.d files through rpm and while
    we don't support 'r' and 'm' at this time, we shouldn't really call
    them "invalid" and error out. Issue a warning instead, and ignore.
    
    This is the first half of
    https://bugzilla.redhat.com/show_bug.cgi?id=2246236
    
    (cherry picked from commit 43cf645fc1fab93b5424cfc22cb520eb486fdbee)

commit 323e3f7053173a052eefc0ce4fb5aa4f9d879aaf
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Fri Nov 3 11:51:11 2023 +0200

    Fix an apparent thinko/typo in the sysusers test spec
    
    I'm quite sure I didn't really intend to test duplicate files behavior
    here...
    
    (cherry picked from commit d141c874b3281a806bc027d0cf6cf22afd759f7a)

commit 6a9934c781862df84a77c6be47633b37f0b9fee7
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Fri Nov 3 11:34:54 2023 +0200

    Use macro error reporting for %add_sysuser errors
    
    Lua has error() but no warning() (obviously) which we'll want in the next
    step, so for consistency lets just use macro.error() instead.
    
    (cherry picked from commit 22e177f428a2afec2db8adad032c17e954ce0a59)

commit 899ffecfdfe9fbb38958d21fd60ee864ceeeef52
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Mon Nov 6 15:58:54 2023 +0200

    Expose and document rpmdb --verifydb operation
    
    After years of BDB, sometimes folks just want some assurance that their db
    is still fine. Properly exposing an operation to do so hopefully makes
    less likely to poke at the db directly (with eg sqlite3 command).
    
    (cherry picked from commit 173b737f40e7da85f79544e3f4ea4ad7b8f7d5c2)

commit d0f98715c990483eed802580a17349f3230831e5
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Mon Nov 6 15:58:07 2023 +0200

    Document rpmdb --exportdb and --importdb switches + minor other tweaks
    
    (cherry picked from commit e85a8a63692a37db7df7384310749cbfa796183a)

commit 6bab2c0b1df040800f6274e9ce81eb44163efea2
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Mon Nov 6 12:35:56 2023 +0200

    Properly document our different macro types and their scopes
    
    (cherry picked from commit f8b4c99bd874c56cef73ab1ca204e225eebae8a7)

commit 8ae49748bc27fcdfc67c6f724f5a51deb31f690c
Author: Michal Domonkos <mdomonko@redhat.com>
Date:   Tue Oct 31 16:37:44 2023 +0100

    Exit from mktree on failure
    
    Right now, if the podman image fails to build or rpm fails to
    build/install, we happily continue and run the test-suite, only to
    eventually fail with some cryptic error, such as:
    
        error: cannot find rpm
    
    Not too helpful, indeed.  Instead, just fail the whole tree preparation
    process if we encounter an error.
    
    Fix the return code of unshared() so that we don't fail on that, though.
    Also, when building the RPM layer, use a proper cleanup trap instead of
    ignoring SIGINT since a failing make_install() can now terminate the
    script.
    
    Fixes: #2667
    (cherry picked from commit 302793af0b80defd77c750bdcf1a8721d75353e1)

commit e1b94c6cf10722eb1029f48eb11aeda62f922ed8
Author: Michal Domonkos <mdomonko@redhat.com>
Date:   Fri Oct 27 11:00:07 2023 +0200

    Rename mktree.podman to mktree.oci
    
    This name is a better fit as it puts more emphasis on the format of the
    resulting tree, not as much on the actual container engine used (which
    can be swapped, and currently is in the CI where we use docker instead
    of podman).
    
    Also drop the awkward .docker symlink now and instead pass the container
    engine through the MKTREE_ENGINE environment variable.
    
    (cherry picked from commit 05c3b37d1f8f91c3face5eeafe8d4c76fbdda495)

commit 9f3ff6939c7f9b5e7738feda6420bf43ef903c39
Author: Michal Domonkos <mdomonko@redhat.com>
Date:   Fri Oct 27 13:55:20 2023 +0200

    Remove sudo from GH workflow
    
    Turns out the docker command in CI is set up such that it doesn't need
    an explicit sudo, so remove it.  This will also allow us to easily pass
    environment variables to mktree in the next commit (as otherwise we'd
    have to use the ugly -E, --preserve-env option).
    
    No functional change.
    
    (cherry picked from commit 15897bca7fe2305434fbef3928152019c5e0ce9a)

commit a9f259b35f1883518f8f5c31960cc3f5349842dd
Author: Michal Domonkos <mdomonko@redhat.com>
Date:   Fri Oct 27 16:05:01 2023 +0200
