Re: [Rpm-maint] [rpm-software-management/rpm] Add Key Fingerprints to rpmsinfoMsg() (PR #3321)

2024-09-23 Thread Panu Matilainen
> For now I have not remove the key IDs from the messages. I wonder if keeping > them is more backward compatible. While they are technical redundant figuring > out the key IDs from the fingerprints is kinda annoying for anyone parsing > the output. See my point about splitting the fingerprint

[Rpm-maint] [rpm-software-management/rpm] Remove brp-elfperms script (PR #3324)

2024-09-23 Thread Shreenidhi Shedi
This is done based on discussion at: https://github.com/rpm-software-management/rpm/discussions/3195 You can view, comment on, or merge this pull request online at: https://github.com/rpm-software-management/rpm/pull/3324 -- Commit Summary -- * Remove brp-elfperms script -- File Changes --

Re: [Rpm-maint] [rpm-software-management/rpm] Return to Tralla La or: RPM in C++ (Discussion #2983)

2024-09-23 Thread Panu Matilainen
Yeah I''ve been slowly approaching he conclusion that uncaught exceptions are probably the lesser evil afterall. I mumble about rpm's allocator in the above and your comment made me realize that rpm's allocator does not get used currently for `new`, so all these places that assume allocation ca

Re: [Rpm-maint] [rpm-software-management/rpm] Filter Lua deprecation warnings based on the originating rpm version (PR #3270)

2024-09-23 Thread Panu Matilainen
Tests added, this is basically the MVP version that would be targeted at 4.20 backporting. I'll file a separate ticket on disabling these for v6 entirely. -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/pull/3270#issuecomment-2367528722 You ar

Re: [Rpm-maint] [rpm-software-management/rpm] Eliminate/convert manual pthread synchronization with STL counterparts (PR #3302)

2024-09-23 Thread Panu Matilainen
@pmatilai commented on this pull request. > +struct tagTable { +private: +headerTagTableEntry byName[TABLESIZE]; /*!< tags sorted by name */ +headerTagTableEntry byValue[TABLESIZE]; /*!< tags sorted by value */ -/* Initialize tag by-value and by-name lookup tables */ -static void l

[Rpm-maint] [rpm-software-management/rpm] Enable C++ exceptions on the codebase (PR #3325)

2024-09-23 Thread Panu Matilainen
Jan Engelheart pointed out that with -fno-exceptions `new` failing will return a nullptr. Which seems fine until you realize that all of rpm is built on the notion that allocations never fail, they terminate the program instead. Only with the C++ refactorings, a significant portion of the code i

Re: [Rpm-maint] [rpm-software-management/rpm] Return to Tralla La or: RPM in C++ (Discussion #2983)

2024-09-23 Thread Panu Matilainen
Submitted https://github.com/rpm-software-management/rpm/pull/3325 while this is still fresh in memory... -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/discussions/2983#discussioncomment-10724655 You are receiving this because you are subscr

Re: [Rpm-maint] [rpm-software-management/rpm] Add Key Fingerprints to rpmsinfoMsg() (PR #3321)

2024-09-23 Thread Panu Matilainen
@pmatilai commented on this pull request. > @@ -305,13 +306,30 @@ const char *rpmsinfoDescr(struct rpmsinfo_s *sinfo) char *rpmsinfoMsg(struct rpmsinfo_s *sinfo) { char *msg = NULL; +char *fphex = NULL; +char *fpmsg = NULL; +if (sinfo->rc == RPMRC_OK && sinfo->key) { + u

Re: [Rpm-maint] [rpm-software-management/rpm] Add Key Fingerprints to rpmsinfoMsg() (PR #3321)

2024-09-23 Thread Panu Matilainen
@pmatilai commented on this pull request. > @@ -591,9 +609,11 @@ static rpmRC verifySignature(rpmKeyring keyring, struct rpmsinfo_s *sinfo) { rpmRC res = RPMRC_FAIL; -if (pgpSignatureType(sinfo->sig) == PGPSIGTYPE_BINARY) - res = rpmKeyringVerifySig(keyring, sinfo->sig, sinfo->c

Re: [Rpm-maint] [rpm-software-management/rpm] Add Key Fingerprints to rpmsinfoMsg() (PR #3321)

2024-09-23 Thread Panu Matilainen
@pmatilai commented on this pull request. > free(pgpsubkeys); } *count = pgpsubkeysCount; return subkeys; } + +int rpmPubkeyFingerprint(rpmPubkey key, uint8_t **fp, size_t *fplen) +{ +if (key == NULL) + return -1; +key = key->mainkey; +pthread_rwlock_r

Re: [Rpm-maint] [rpm-software-management/rpm] Add Key Fingerprints to rpmsinfoMsg() (PR #3321)

2024-09-23 Thread Panu Matilainen
@pmatilai commented on this pull request. > @@ -304,10 +319,16 @@ rpmRC rpmKeyringVerifySig(rpmKeyring keyring, > pgpDigParams sig, DIGEST_CTX ctx) rpmlog(rc ? RPMLOG_ERR : RPMLOG_WARNING, "%s\n", lints); free(lints); } -} - -if (keyring) + if (keyp

Re: [Rpm-maint] [rpm-software-management/rpm] Filter Lua deprecation warnings based on the originating rpm version (PR #3270)

2024-09-23 Thread Panu Matilainen
@pmatilai pushed 2 commits. f11cc5108d8a45489a4a04f7245f8c421da73bff Refactor scriptlet runner functions to take an actual rpmscript struct 90e43ee0ad93f2d5850c9773ff225297fc08772a Filter Lua deprecation warnings based on the originating rpm version -- View it on GitHub: https://github.com/r

[Rpm-maint] [rpm-software-management/rpm] Disable Lua posix.fork() and friends on v6 packages (Issue #3323)

2024-09-23 Thread Panu Matilainen
As discussed in #3270, we can't actually *remove* the support for posix.fork() and the associated functions even in v6, because the handful of users are actually key packages in distros, and removing the functionality would be a far, far bigger compatibility break than v6 format, and that makes

Re: [Rpm-maint] [rpm-software-management/rpm] Return to Tralla La or: RPM in C++ (Discussion #2983)

2024-09-23 Thread Jan Engelhardt
Uncaught C++ exceptions also terminate the program, which is perhaps slightly better than a -fno-exceptions program not knowing what to do: While `new T();` would return `nullptr` under libstdc++ with -fno-exceptions, no such check could be made for e.g. `std::string s; s.resize(verylargevalue);

Re: [Rpm-maint] [rpm-software-management/rpm] Eliminate/convert manual pthread synchronization with STL counterparts (PR #3302)

2024-09-23 Thread Panu Matilainen
@pmatilai commented on this pull request. > +struct tagTable { +private: +headerTagTableEntry byName[TABLESIZE]; /*!< tags sorted by name */ +headerTagTableEntry byValue[TABLESIZE]; /*!< tags sorted by value */ -/* Initialize tag by-value and by-name lookup tables */ -static void l

Re: [Rpm-maint] [rpm-software-management/rpm] Eliminate/convert manual pthread synchronization with STL counterparts (PR #3302)

2024-09-23 Thread ニール・ゴンパ
@Conan-Kudo commented on this pull request. > +struct tagTable { +private: +headerTagTableEntry byName[TABLESIZE]; /*!< tags sorted by name */ +headerTagTableEntry byValue[TABLESIZE]; /*!< tags sorted by value */ -/* Initialize tag by-value and by-name lookup tables */ -static void

Re: [Rpm-maint] [rpm-software-management/rpm] Eliminate/convert manual pthread synchronization with STL counterparts (PR #3302)

2024-09-23 Thread Panu Matilainen
@pmatilai commented on this pull request. > +struct tagTable { +private: +headerTagTableEntry byName[TABLESIZE]; /*!< tags sorted by name */ +headerTagTableEntry byValue[TABLESIZE]; /*!< tags sorted by value */ -/* Initialize tag by-value and by-name lookup tables */ -static void l

Re: [Rpm-maint] [rpm-software-management/rpm] Eliminate/convert manual pthread synchronization with STL counterparts (PR #3302)

2024-09-23 Thread ニール・ゴンパ
@Conan-Kudo commented on this pull request. > +struct tagTable { +private: +headerTagTableEntry byName[TABLESIZE]; /*!< tags sorted by name */ +headerTagTableEntry byValue[TABLESIZE]; /*!< tags sorted by value */ -/* Initialize tag by-value and by-name lookup tables */ -static void

Re: [Rpm-maint] [rpm-software-management/rpm] Reference Manual: RPM's Philosophy (PR #3299)

2024-09-23 Thread Panu Matilainen
Just realized this will make a nice addition to the contributing guide: when contributing / planning to, make sure the work aligns with rpm's link-to-design-philosophy. Doesn't have to be added in this very PR but wouldn't hurt either. -- Reply to this email directly or view it on GitHub: http

Re: [Rpm-maint] [rpm-software-management/rpm] Filter Lua deprecation warnings based on the originating rpm version (PR #3270)

2024-09-23 Thread Panu Matilainen
@pmatilai pushed 1 commit. 56ebcd0af2dcc56fa938e2bd6f8436a660ad99b4 Filter Lua deprecation warnings based on the originating rpm version -- View it on GitHub: https://github.com/rpm-software-management/rpm/pull/3270/files/90e43ee0ad93f2d5850c9773ff225297fc08772a..56ebcd0af2dcc56fa938e2bd6f8436

Re: [Rpm-maint] [rpm-software-management/rpm] Add Key Fingerprints to rpmsinfoMsg() (PR #3321)

2024-09-23 Thread Florian Festi
@ffesti commented on this pull request. > @@ -305,13 +306,30 @@ const char *rpmsinfoDescr(struct rpmsinfo_s *sinfo) char *rpmsinfoMsg(struct rpmsinfo_s *sinfo) { char *msg = NULL; +char *fphex = NULL; +char *fpmsg = NULL; +if (sinfo->rc == RPMRC_OK && sinfo->key) { + uin

Re: [Rpm-maint] [rpm-software-management/rpm] Add Key Fingerprints to rpmsinfoMsg() (PR #3321)

2024-09-23 Thread Florian Festi
@ffesti commented on this pull request. > @@ -591,9 +609,11 @@ static rpmRC verifySignature(rpmKeyring keyring, struct rpmsinfo_s *sinfo) { rpmRC res = RPMRC_FAIL; -if (pgpSignatureType(sinfo->sig) == PGPSIGTYPE_BINARY) - res = rpmKeyringVerifySig(keyring, sinfo->sig, sinfo->ctx

Re: [Rpm-maint] [rpm-software-management/rpm] Add Key Fingerprints to rpmsinfoMsg() (PR #3321)

2024-09-23 Thread Florian Festi
@ffesti pushed 2 commits. 44ef3bc1dabd7b2f5d4d653afa78db2292466071 Add rpmKeyringVerifySig2 that return the matching key 0352deffbefd673a97e4178481fa0a917081dea6 Add Key Fingerprints to rpmsinfoMsg() -- View it on GitHub: https://github.com/rpm-software-management/rpm/pull/3321/files/7f8d5c1c

Re: [Rpm-maint] [rpm-software-management/rpm] Eliminate/convert manual pthread synchronization with STL counterparts (PR #3302)

2024-09-23 Thread Michal Domonkos
@dmnks commented on this pull request. > @@ -2139,7 +2114,6 @@ rpmExpand(const char *arg, ...) rpmMacroContext mc = rpmmctxAcquire(NULL); Isn't locking required here, too? > int cbrc = RPMLOG_DEFAULT; int needexit = 0; FILE *clog = NULL; rpmlogCallbackData cbdata = N

Re: [Rpm-maint] [rpm-software-management/rpm] Bump the lowest level file digest default to SHA256 too (PR #3326)

2024-09-23 Thread Florian Festi
Merged #3326 into master. -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/pull/3326#event-14367567035 You are receiving this because you are subscribed to this thread. Message ID: ___ Rpm-maint mail

Re: [Rpm-maint] [rpm-software-management/rpm] Enable C++ exceptions on the codebase (PR #3325)

2024-09-23 Thread Florian Festi
Merged #3325 into master. -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/pull/3325#event-14367583163 You are receiving this because you are subscribed to this thread. Message ID: ___ Rpm-maint mail

Re: [Rpm-maint] [rpm-software-management/rpm] Use long PGP Key IDs for all outputs (PR #3292)

2024-09-23 Thread Florian Festi
Closed #3292. -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/pull/3292#event-14367634542 You are receiving this because you are subscribed to this thread. Message ID: ___ Rpm-maint mailing list Rpm

Re: [Rpm-maint] [rpm-software-management/rpm] Add Key Fingerprints to rpmsinfoMsg() (PR #3321)

2024-09-23 Thread Florian Festi
@ffesti commented on this pull request. > free(pgpsubkeys); } *count = pgpsubkeysCount; return subkeys; } + +int rpmPubkeyFingerprint(rpmPubkey key, uint8_t **fp, size_t *fplen) +{ +if (key == NULL) + return -1; +key = key->mainkey; +pthread_rwlock_rdl

Re: [Rpm-maint] [rpm-software-management/rpm] Use long PGP Key IDs for all outputs (PR #3292)

2024-09-23 Thread Florian Festi
I have added these changes to #3321. So it is redundant now. Closing. -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/pull/3292#issuecomment-2368874403 You are receiving this because you are subscribed to this thread. Message ID: _

Re: [Rpm-maint] [rpm-software-management/rpm] Filter Lua deprecation warnings based on the originating rpm version (PR #3270)

2024-09-23 Thread Florian Festi
Merged #3270 into master. -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/pull/3270#event-14367671616 You are receiving this because you are subscribed to this thread. Message ID: ___ Rpm-maint mail

Re: [Rpm-maint] [rpm-software-management/rpm] Add Key Fingerprints to rpmsinfoMsg() (PR #3321)

2024-09-23 Thread Panu Matilainen
Fishing out an example output from the CI run to make it easier to discuss: ``` /tmp/hello-2.0-1.x86_64.rpm: -Header V4 ECDSA/SHA256 Signature, key ID 5f65bbe8: OK +Header V4 ECDSA/SHA256 Signature, key ID 5f65bbe8: OK, Key Fingerprint: e8a62c0512b06b5d2183ba207f1c21f95f65bbe8 ``` The :O

Re: [Rpm-maint] [rpm-software-management/rpm] Add Key Fingerprints to rpmsinfoMsg() (PR #3321)

2024-09-23 Thread Panu Matilainen
@pmatilai commented on this pull request. > @@ -107,6 +117,15 @@ rpmPubkey rpmPubkeyLink(rpmPubkey key); */ char * rpmPubkeyBase64(rpmPubkey key); +/** \ingroup rpmkeyring + * Return fingerprint of primary key + * @param key Pubkey + * @param fp Fingerprint data + * @para

[Rpm-maint] [rpm-software-management/rpm] Bump the lowest level file digest default to SHA256 too (PR #3326)

2024-09-23 Thread Panu Matilainen
Should've been in commit 0cd74ade37d16d282d13e781deb68a219b2c04b9 already, didn't even realize we have such a hardcoded default in code too until accidentally stumbled on it a few days ago. This only affects anything if rpm's own normal macro configuration isn't available at all, so just an obs

Re: [Rpm-maint] [rpm-software-management/rpm] Eliminate/convert manual pthread synchronization with STL counterparts (PR #3302)

2024-09-23 Thread Michal Domonkos
@dmnks commented on this pull request. > +struct tagTable { +private: +headerTagTableEntry byName[TABLESIZE]; /*!< tags sorted by name */ +headerTagTableEntry byValue[TABLESIZE]; /*!< tags sorted by value */ -/* Initialize tag by-value and by-name lookup tables */ -static void load

Re: [Rpm-maint] [rpm-software-management/rpm] Eliminate/convert manual pthread synchronization with STL counterparts (PR #3302)

2024-09-23 Thread Michal Domonkos
@dmnks commented on this pull request. > +struct tagTable { +private: +headerTagTableEntry byName[TABLESIZE]; /*!< tags sorted by name */ +headerTagTableEntry byValue[TABLESIZE]; /*!< tags sorted by value */ -/* Initialize tag by-value and by-name lookup tables */ -static void load

Re: [Rpm-maint] [rpm-software-management/rpm] Eliminate/convert manual pthread synchronization with STL counterparts (PR #3302)

2024-09-23 Thread Michal Domonkos
@dmnks commented on this pull request. > +struct tagTable { +private: +headerTagTableEntry byName[TABLESIZE]; /*!< tags sorted by name */ +headerTagTableEntry byValue[TABLESIZE]; /*!< tags sorted by value */ -/* Initialize tag by-value and by-name lookup tables */ -static void load

Re: [Rpm-maint] [rpm-software-management/rpm] Eliminate/convert manual pthread synchronization with STL counterparts (PR #3302)

2024-09-23 Thread Panu Matilainen
@pmatilai commented on this pull request. > +struct tagTable { +private: +headerTagTableEntry byName[TABLESIZE]; /*!< tags sorted by name */ +headerTagTableEntry byValue[TABLESIZE]; /*!< tags sorted by value */ -/* Initialize tag by-value and by-name lookup tables */ -static void l

Re: [Rpm-maint] [rpm-software-management/rpm] Add Key Fingerprints to rpmsinfoMsg() (PR #3321)

2024-09-23 Thread Michael Schroeder
Maybe it's a good idea to also return the pubkey version with the fingerprint if you're adding a new API function. -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/pull/3321#issuecomment-2367668999 You are receiving this because you are subscri

Re: [Rpm-maint] [rpm-software-management/rpm] Add Key Fingerprints to rpmsinfoMsg() (PR #3321)

2024-09-23 Thread Florian Festi
@ffesti pushed 5 commits. b2e11786497a89e035ef2fed224f4fa67b607e1c Use long PGP Key IDs for all outputs 970b708e3a3fab4bb4802cca84a9d403a57bacd9 Use long PGP Key Ids in our test cases bbc00e4b09e06d57772c4766acd876ef7b8b1184 Add rpmPubkeyFingerprint 760f81e6a918460835faddf8b6591b57aad9cbe3 Add

Re: [Rpm-maint] [rpm-software-management/rpm] Add Key Fingerprints to rpmsinfoMsg() (PR #3321)

2024-09-23 Thread Florian Festi
OK, put https://github.com/rpm-software-management/rpm/pull/3292 underneath, adjusted the message and the name of `rpmPubkeyFingerprint` and make the test cases pass. For now I have not remove the key IDs from the messages. I wonder if keeping them is more backward compatible. While they are te

Re: [Rpm-maint] [rpm-software-management/rpm] Add Key Fingerprints to rpmsinfoMsg() (PR #3321)

2024-09-23 Thread Florian Festi
@ffesti commented on this pull request. > @@ -107,6 +117,15 @@ rpmPubkey rpmPubkeyLink(rpmPubkey key); */ char * rpmPubkeyBase64(rpmPubkey key); +/** \ingroup rpmkeyring + * Return fingerprint of primary key + * @param key Pubkey + * @param fp Fingerprint data + * @param

Re: [Rpm-maint] [rpm-software-management/rpm] Enable C++ exceptions on the codebase (PR #3325)

2024-09-23 Thread ニール・ゴンパ
@Conan-Kudo approved this pull request. -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/pull/3325#pullrequestreview-2321870760 You are receiving this because you are subscribed to this thread. Message ID: __

Re: [Rpm-maint] [rpm-software-management/rpm] Eliminate/convert manual pthread synchronization with STL counterparts (PR #3302)

2024-09-23 Thread ニール・ゴンパ
@Conan-Kudo commented on this pull request. > +struct tagTable { +private: +headerTagTableEntry byName[TABLESIZE]; /*!< tags sorted by name */ +headerTagTableEntry byValue[TABLESIZE]; /*!< tags sorted by value */ -/* Initialize tag by-value and by-name lookup tables */ -static void

Re: [Rpm-maint] [rpm-software-management/rpm] Eliminate/convert manual pthread synchronization with STL counterparts (PR #3302)

2024-09-23 Thread Panu Matilainen
@pmatilai commented on this pull request. > +struct tagTable { +private: +headerTagTableEntry byName[TABLESIZE]; /*!< tags sorted by name */ +headerTagTableEntry byValue[TABLESIZE]; /*!< tags sorted by value */ -/* Initialize tag by-value and by-name lookup tables */ -static void l

Re: [Rpm-maint] [rpm-software-management/rpm] Eliminate/convert manual pthread synchronization with STL counterparts (PR #3302)

2024-09-23 Thread ニール・ゴンパ
@Conan-Kudo commented on this pull request. > +struct tagTable { +private: +headerTagTableEntry byName[TABLESIZE]; /*!< tags sorted by name */ +headerTagTableEntry byValue[TABLESIZE]; /*!< tags sorted by value */ -/* Initialize tag by-value and by-name lookup tables */ -static void

Re: [Rpm-maint] [rpm-software-management/rpm] Eliminate/convert manual pthread synchronization with STL counterparts (PR #3302)

2024-09-23 Thread Panu Matilainen
@pmatilai commented on this pull request. > int cbrc = RPMLOG_DEFAULT; int needexit = 0; FILE *clog = NULL; rpmlogCallbackData cbdata = NULL; rpmlogCallback cbfunc = NULL; -rpmlogCtx ctx = rpmlogCtxAcquire(saverec); - -if (ctx == NULL) - return; +rpmlog

Re: [Rpm-maint] [rpm-software-management/rpm] Eliminate/convert manual pthread synchronization with STL counterparts (PR #3302)

2024-09-23 Thread Panu Matilainen
@pmatilai commented on this pull request. > +struct tagTable { +private: +headerTagTableEntry byName[TABLESIZE]; /*!< tags sorted by name */ +headerTagTableEntry byValue[TABLESIZE]; /*!< tags sorted by value */ -/* Initialize tag by-value and by-name lookup tables */ -static void l

Re: [Rpm-maint] [rpm-software-management/rpm] Eliminate/convert manual pthread synchronization with STL counterparts (PR #3302)

2024-09-23 Thread Panu Matilainen
@pmatilai commented on this pull request. > @@ -2139,7 +2114,6 @@ rpmExpand(const char *arg, ...) rpmMacroContext mc = rpmmctxAcquire(NULL); Oops, certainly. Good spotting! This is why we have this code review thing :smile: I may have been thinking of moving the locking inside doExpan

Re: [Rpm-maint] [rpm-software-management/rpm] Eliminate/convert manual pthread synchronization with STL counterparts (PR #3302)

2024-09-23 Thread Panu Matilainen
@pmatilai commented on this pull request. > @@ -2139,7 +2114,6 @@ rpmExpand(const char *arg, ...) rpmMacroContext mc = rpmmctxAcquire(NULL); Added. -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/pull/3302#discussion_r1772736613 You

Re: [Rpm-maint] [rpm-software-management/rpm] Eliminate/convert manual pthread synchronization with STL counterparts (PR #3302)

2024-09-23 Thread Panu Matilainen
@pmatilai pushed 10 commits. 222470db604704ed128b3a54f2c54d47e2809d28 Take advantage of C++ native mutex facilities for macro locking af066ad0aab46baa1f27d6c1c88126ece7babc92 Take advantage of C++ native mutex facilities for string pool 716258512a618fc389d5422cc4d0ffedb3d4eb26 Take advantage

Re: [Rpm-maint] [rpm-software-management/rpm] Eliminate/convert manual pthread synchronization with STL counterparts (PR #3302)

2024-09-23 Thread Panu Matilainen
@pmatilai commented on this pull request. > +struct tagTable { +private: +headerTagTableEntry byName[TABLESIZE]; /*!< tags sorted by name */ +headerTagTableEntry byValue[TABLESIZE]; /*!< tags sorted by value */ -/* Initialize tag by-value and by-name lookup tables */ -static void l