Bug 246145 - devel/json-c: Update to 0.14
Summary: devel/json-c: Update to 0.14
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Po-Chuan Hsieh
URL:
Keywords: security
Depends on: 246389
Blocks:
  Show dependency treegraph
 
Reported: 2020-05-03 17:03 UTC by Daniel Engberg
Modified: 2020-05-21 20:52 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (sunpoet)


Attachments
Patch for json-c (4.57 KB, patch)
2020-05-03 17:03 UTC, Daniel Engberg
no flags Details | Diff
Patch for json-c v2 (4.66 KB, patch)
2020-05-05 19:40 UTC, Daniel Engberg
no flags Details | Diff
Patch for json-c v3 (4.65 KB, patch)
2020-05-12 06:08 UTC, Daniel Engberg
no flags Details | Diff
Patch for json-c v4 (17.37 KB, patch)
2020-05-14 09:51 UTC, Daniel Engberg
no flags Details | Diff
Patch for json-c v5 (17.24 KB, patch)
2020-05-14 10:12 UTC, Daniel Engberg
no flags Details | Diff
Patch for json-c v6 (17.15 KB, application/mbox)
2020-05-14 10:30 UTC, Daniel Engberg
no flags Details
Patch for json-c v7 (18.56 KB, patch)
2020-05-14 12:39 UTC, Daniel Engberg
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Engberg freebsd_committer freebsd_triage 2020-05-03 17:03:19 UTC
Created attachment 214066 [details]
Patch for json-c

Update json-c to 0.14
Switch to CMake
Remove patches as they're merged in upstream repo

Tested on FreeBSD 13.0-CURRENT r360454 (make test) both static and shared successfully.
Poudriere testport OK 12.1-RELEASE (AMD64)
Comment 1 Daniel Engberg freebsd_committer freebsd_triage 2020-05-05 19:40:07 UTC
Created attachment 214171 [details]
Patch for json-c v2

Set USE_LDCONFIG variable
Comment 2 Daniel Engberg freebsd_committer freebsd_triage 2020-05-12 00:22:47 UTC
Hi Sunpoet,

Is this something you can have a look at?

Best regards,
Daniel
Comment 3 Daniel Engberg freebsd_committer freebsd_triage 2020-05-12 06:08:08 UTC
Created attachment 214403 [details]
Patch for json-c v3

Remove pkgconfig in USES=
Comment 4 Daniel Engberg freebsd_committer freebsd_triage 2020-05-14 09:51:14 UTC
Created attachment 214481 [details]
Patch for json-c v4

Backport CMake changes, restores static lib
Backport fix for CVE-2020-12762
Comment 5 Daniel Engberg freebsd_committer freebsd_triage 2020-05-14 10:12:07 UTC
Created attachment 214483 [details]
Patch for json-c v5

Forgot to remove workaround in Makefile for upstream PR 585 as CMake related files are up to date. Sorry!
Comment 6 Daniel Engberg freebsd_committer freebsd_triage 2020-05-14 10:30:00 UTC
Created attachment 214486 [details]
Patch for json-c v6

Restore USE_LDCONFIG
Comment 7 Matthias Andree freebsd_committer freebsd_triage 2020-05-14 11:32:42 UTC
Note I've marked json-c < 0.15 vulnerable per r535226, so if the security fix be backported, then also change the version in security/vuxml/vuln.xml accordingly.
Comment 8 Daniel Engberg freebsd_committer freebsd_triage 2020-05-14 12:39:18 UTC
Created attachment 214488 [details]
Patch for json-c v7

Partially backport commit 519dfe1591d85432986f9762d41d1a883198c157 to fix regression reported in issue #599
Comment 9 Daniel Engberg freebsd_committer freebsd_triage 2020-05-14 12:49:10 UTC
Summary of as of v7

Update json-c to 0.14
Switch to CMake
Remove patches as they're merged in upstream repo
Partially backport CMake changes from master branch as of 20200510, fixes building both static and shared libraries
Backport upstream PR585, fixes CVE-2020-12762
Partially backport commit 519dfe1, fixes regression (issue #599)

References:
https://github.com/json-c/json-c/pull/585
https://svnweb.freebsd.org/ports?view=revision&revision=535226
https://github.com/json-c/json-c/issues/599
Comment 10 Po-Chuan Hsieh freebsd_committer freebsd_triage 2020-05-14 20:06:00 UTC
Thanks for your information and the patch. But I still have to make the patch from scratch. For example, I would keep the github commit links in the patch file to help identify where it comes from.

And I don't understand why you added changes to cmake-configure and cmake/config.h.in.

I've added the following commits to the newer patch in bug #246389.
https://github.com/json-c/json-c/commit/22870ac2bd4cfdd135887ecc8cbbe02e7ef0c34e
https://github.com/json-c/json-c/commit/31243e4d1204ef78be34b0fcae73221eee6b83be
https://github.com/json-c/json-c/commit/4f43a077a497f94214645ce9763247ec085e2094
https://github.com/json-c/json-c/commit/519dfe1591d85432986f9762d41d1a883198c157
https://github.com/json-c/json-c/commit/8b511c402b73d1d8b195991891c8d44859cb57ec

Let's wait for the exp-run result. Thanks!
Comment 11 Po-Chuan Hsieh freebsd_committer freebsd_triage 2020-05-14 20:10:06 UTC
(In reply to Matthias Andree from comment #7)

Thanks for adding the vuxml entry. I've updated the patch for exp-run. That means the security fix would land the ports tree along with 0.14 update. I'll changed it to <lt>0.14</lt>.
Comment 12 Daniel Engberg freebsd_committer freebsd_triage 2020-05-16 21:38:57 UTC
(In reply to Sunpoet Po-Chuan Hsieh from comment #10)

Hi,

Since the CMake files had multiple changes to them after the release I went with the easiest way of fixing building of both static and shared libraries instead of trying to partially backport multiple commits. I also made the assumption that these will be obsolete (fixed) in the next release.

cmake-configure --> https://github.com/json-c/json-c/commit/a100573eecf66daa6b50113c016b8a2563b1504e#diff-008f08ef2adf0ae7ac47d03611a35922

As for cmake/config.h.in unless I misread the diffs it seems to touch more than what the commit message suggests so I went for the latest version to avoid build issues.
https://github.com/json-c/json-c/commits/master/cmake/config.h.in

Best regards,
Daniel
Comment 13 Po-Chuan Hsieh freebsd_committer freebsd_triage 2020-05-17 18:45:25 UTC
(In reply to Matthias Andree from comment #7)

I've added the security fix into the json-c 0.14 patch for exp-run, thus I'll change it to 0.14.
Comment 14 Dani I. 2020-05-20 09:30:57 UTC
Bump - it would be really appreciated if this could be pushed a bit as this is security relevant! Thanks!
Comment 15 Po-Chuan Hsieh freebsd_committer freebsd_triage 2020-05-21 20:52:15 UTC
json-c 0.14 landed.