diff --git a/.gitignore b/.gitignore index 757f094..51ff766 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/json-c-0.13.1-20180305.tar.gz +json-c-0.18-20240915.tar.gz diff --git a/.json-c.metadata b/.json-c.metadata deleted file mode 100644 index 1216dfb..0000000 --- a/.json-c.metadata +++ /dev/null @@ -1 +0,0 @@ -d4c667ab94e7051b1e78aa727f0d937caba971e9 SOURCES/json-c-0.13.1-20180305.tar.gz diff --git a/SOURCES/json-c-int-overflow.patch b/SOURCES/json-c-int-overflow.patch deleted file mode 100644 index 8fa4ae1..0000000 --- a/SOURCES/json-c-int-overflow.patch +++ /dev/null @@ -1,206 +0,0 @@ -diff --git a/arraylist.c b/arraylist.c -index ddeb8d4eb4..e737052e32 100644 ---- a/arraylist.c -+++ b/arraylist.c -@@ -135,6 +135,9 @@ array_list_del_idx( struct array_list *arr, size_t idx, size_t count ) - { - size_t i, stop; - -+ /* Avoid overflow in calculation with large indices. */ -+ if (idx > SIZE_T_MAX - count) -+ return -1; - stop = idx + count; - if ( idx >= arr->length || stop > arr->length ) return -1; - for ( i = idx; i < stop; ++i ) { -diff --git a/linkhash.c b/linkhash.c -index 5497061a8a..6435a154ac 100644 ---- a/linkhash.c -+++ b/linkhash.c -@@ -12,12 +12,13 @@ - - #include "config.h" - --#include --#include --#include -+#include -+#include - #include - #include --#include -+#include -+#include -+#include - - #ifdef HAVE_ENDIAN_H - # include /* attempt to define endianness */ -@@ -28,8 +29,8 @@ - # include /* Get InterlockedCompareExchange */ - #endif - --#include "random_seed.h" - #include "linkhash.h" -+#include "random_seed.h" - - /* hash functions */ - static unsigned long lh_char_hash(const void *k); -@@ -498,7 +499,9 @@ struct lh_table* lh_table_new(int size, - int i; - struct lh_table *t; - -- t = (struct lh_table*)calloc(1, sizeof(struct lh_table)); -+ /* Allocate space for elements to avoid divisions by zero. */ -+ assert(size > 0); -+ t = (struct lh_table *)calloc(1, sizeof(struct lh_table)); - if (!t) - return NULL; - -@@ -577,8 +580,12 @@ int lh_table_insert_w_hash(struct lh_table *t, const void *k, const void *v, con - unsigned long n; - - if (t->count >= t->size * LH_LOAD_FACTOR) -- if (lh_table_resize(t, t->size * 2) != 0) -+ { -+ /* Avoid signed integer overflow with large tables. */ -+ int new_size = (t->size > INT_MAX / 2) ? INT_MAX : (t->size * 2); -+ if (t->size == INT_MAX || lh_table_resize(t, new_size) != 0) - return -1; -+ } - - n = h % t->size; - -diff --git a/printbuf.c b/printbuf.c -index 6c77b5defd..6fc56de455 100644 ---- a/printbuf.c -+++ b/printbuf.c -@@ -15,6 +15,7 @@ - - #include "config.h" - -+#include - #include - #include - #include -@@ -64,10 +65,16 @@ static int printbuf_extend(struct printbuf *p, int min_size) - - if (p->size >= min_size) - return 0; -- -- new_size = p->size * 2; -- if (new_size < min_size + 8) -- new_size = min_size + 8; -+ /* Prevent signed integer overflows with large buffers. */ -+ if (min_size > INT_MAX - 8) -+ return -1; -+ if (p->size > INT_MAX / 2) -+ new_size = min_size + 8; -+ else { -+ new_size = p->size * 2; -+ if (new_size < min_size + 8) -+ new_size = min_size + 8; -+ } - #ifdef PRINTBUF_DEBUG - MC_DEBUG("printbuf_memappend: realloc " - "bpos=%d min_size=%d old_size=%d new_size=%d\n", -@@ -82,14 +89,18 @@ static int printbuf_extend(struct printbuf *p, int min_size) - - int printbuf_memappend(struct printbuf *p, const char *buf, int size) - { -- if (p->size <= p->bpos + size + 1) { -- if (printbuf_extend(p, p->bpos + size + 1) < 0) -- return -1; -- } -- memcpy(p->buf + p->bpos, buf, size); -- p->bpos += size; -- p->buf[p->bpos]= '\0'; -- return size; -+ /* Prevent signed integer overflows with large buffers. */ -+ if (size > INT_MAX - p->bpos - 1) -+ return -1; -+ if (p->size <= p->bpos + size + 1) -+ { -+ if (printbuf_extend(p, p->bpos + size + 1) < 0) -+ return -1; -+ } -+ memcpy(p->buf + p->bpos, buf, size); -+ p->bpos += size; -+ p->buf[p->bpos] = '\0'; -+ return size; - } - - int printbuf_memset(struct printbuf *pb, int offset, int charvalue, int len) -@@ -98,6 +109,9 @@ int printbuf_memset(struct printbuf *pb, int offset, int charvalue, int len) - - if (offset == -1) - offset = pb->bpos; -+ /* Prevent signed integer overflows with large buffers. */ -+ if (len > INT_MAX - offset) -+ return -1; - size_needed = offset + len; - if (pb->size < size_needed) - { -diff --git a/tests/test4.c b/tests/test4.c -index fc8b79dbf4..82d3f494de 100644 ---- a/tests/test4.c -+++ b/tests/test4.c -@@ -2,9 +2,11 @@ - * gcc -o utf8 utf8.c -I/home/y/include -L./.libs -ljson - */ - -+#include "config.h" -+#include - #include -+#include - #include --#include "config.h" - - #include "json_inttypes.h" - #include "json_object.h" -@@ -24,6 +26,29 @@ void print_hex(const char* s) - putchar('\n'); - } - -+static void test_lot_of_adds(void); -+static void test_lot_of_adds() -+{ -+ int ii; -+ char key[50]; -+ json_object *jobj = json_object_new_object(); -+ assert(jobj != NULL); -+ for (ii = 0; ii < 500; ii++) -+ { -+ snprintf(key, sizeof(key), "k%d", ii); -+ json_object *iobj = json_object_new_int(ii); -+ assert(iobj != NULL); -+ if (json_object_object_add(jobj, key, iobj)) -+ { -+ fprintf(stderr, "FAILED to add object #%d\n", ii); -+ abort(); -+ } -+ } -+ printf("%s\n", json_object_to_json_string(jobj)); -+ assert(json_object_object_length(jobj) == 500); -+ json_object_put(jobj); -+} -+ - int main(void) - { - const char *input = "\"\\ud840\\udd26,\\ud840\\udd27,\\ud800\\udd26,\\ud800\\udd27\""; -@@ -49,5 +74,8 @@ int main(void) - retval = 1; - } - json_object_put(parse_result); -+ -+ test_lot_of_adds(); -+ - return retval; - } -diff --git a/tests/test4.expected b/tests/test4.expected -index 68d4336d90..cb2744012b 100644 ---- a/tests/test4.expected -+++ b/tests/test4.expected -@@ -1,3 +1,4 @@ - input: "\ud840\udd26,\ud840\udd27,\ud800\udd26,\ud800\udd27" - JSON parse result is correct: 𠄦,𠄧,𐄦,𐄧 - PASS -+{ "k0": 0, "k1": 1, "k2": 2, "k3": 3, "k4": 4, "k5": 5, "k6": 6, "k7": 7, "k8": 8, "k9": 9, "k10": 10, "k11": 11, "k12": 12, "k13": 13, "k14": 14, "k15": 15, "k16": 16, "k17": 17, "k18": 18, "k19": 19, "k20": 20, "k21": 21, "k22": 22, "k23": 23, "k24": 24, "k25": 25, "k26": 26, "k27": 27, "k28": 28, "k29": 29, "k30": 30, "k31": 31, "k32": 32, "k33": 33, "k34": 34, "k35": 35, "k36": 36, "k37": 37, "k38": 38, "k39": 39, "k40": 40, "k41": 41, "k42": 42, "k43": 43, "k44": 44, "k45": 45, "k46": 46, "k47": 47, "k48": 48, "k49": 49, "k50": 50, "k51": 51, "k52": 52, "k53": 53, "k54": 54, "k55": 55, "k56": 56, "k57": 57, "k58": 58, "k59": 59, "k60": 60, "k61": 61, "k62": 62, "k63": 63, "k64": 64, "k65": 65, "k66": 66, "k67": 67, "k68": 68, "k69": 69, "k70": 70, "k71": 71, "k72": 72, "k73": 73, "k74": 74, "k75": 75, "k76": 76, "k77": 77, "k78": 78, "k79": 79, "k80": 80, "k81": 81, "k82": 82, "k83": 83, "k84": 84, "k85": 85, "k86": 86, "k87": 87, "k88": 88, "k89": 89, "k90": 90, "k91": 91, "k92": 92, "k93": 93, "k94": 94, "k95": 95, "k96": 96, "k97": 97, "k98": 98, "k99": 99, "k100": 100, "k101": 101, "k102": 102, "k103": 103, "k104": 104, "k105": 105, "k106": 106, "k107": 107, "k108": 108, "k109": 109, "k110": 110, "k111": 111, "k112": 112, "k113": 113, "k114": 114, "k115": 115, "k116": 116, "k117": 117, "k118": 118, "k119": 119, "k120": 120, "k121": 121, "k122": 122, "k123": 123, "k124": 124, "k125": 125, "k126": 126, "k127": 127, "k128": 128, "k129": 129, "k130": 130, "k131": 131, "k132": 132, "k133": 133, "k134": 134, "k135": 135, "k136": 136, "k137": 137, "k138": 138, "k139": 139, "k140": 140, "k141": 141, "k142": 142, "k143": 143, "k144": 144, "k145": 145, "k146": 146, "k147": 147, "k148": 148, "k149": 149, "k150": 150, "k151": 151, "k152": 152, "k153": 153, "k154": 154, "k155": 155, "k156": 156, "k157": 157, "k158": 158, "k159": 159, "k160": 160, "k161": 161, "k162": 162, "k163": 163, "k164": 164, "k165": 165, "k166": 166, "k167": 167, "k168": 168, "k169": 169, "k170": 170, "k171": 171, "k172": 172, "k173": 173, "k174": 174, "k175": 175, "k176": 176, "k177": 177, "k178": 178, "k179": 179, "k180": 180, "k181": 181, "k182": 182, "k183": 183, "k184": 184, "k185": 185, "k186": 186, "k187": 187, "k188": 188, "k189": 189, "k190": 190, "k191": 191, "k192": 192, "k193": 193, "k194": 194, "k195": 195, "k196": 196, "k197": 197, "k198": 198, "k199": 199, "k200": 200, "k201": 201, "k202": 202, "k203": 203, "k204": 204, "k205": 205, "k206": 206, "k207": 207, "k208": 208, "k209": 209, "k210": 210, "k211": 211, "k212": 212, "k213": 213, "k214": 214, "k215": 215, "k216": 216, "k217": 217, "k218": 218, "k219": 219, "k220": 220, "k221": 221, "k222": 222, "k223": 223, "k224": 224, "k225": 225, "k226": 226, "k227": 227, "k228": 228, "k229": 229, "k230": 230, "k231": 231, "k232": 232, "k233": 233, "k234": 234, "k235": 235, "k236": 236, "k237": 237, "k238": 238, "k239": 239, "k240": 240, "k241": 241, "k242": 242, "k243": 243, "k244": 244, "k245": 245, "k246": 246, "k247": 247, "k248": 248, "k249": 249, "k250": 250, "k251": 251, "k252": 252, "k253": 253, "k254": 254, "k255": 255, "k256": 256, "k257": 257, "k258": 258, "k259": 259, "k260": 260, "k261": 261, "k262": 262, "k263": 263, "k264": 264, "k265": 265, "k266": 266, "k267": 267, "k268": 268, "k269": 269, "k270": 270, "k271": 271, "k272": 272, "k273": 273, "k274": 274, "k275": 275, "k276": 276, "k277": 277, "k278": 278, "k279": 279, "k280": 280, "k281": 281, "k282": 282, "k283": 283, "k284": 284, "k285": 285, "k286": 286, "k287": 287, "k288": 288, "k289": 289, "k290": 290, "k291": 291, "k292": 292, "k293": 293, "k294": 294, "k295": 295, "k296": 296, "k297": 297, "k298": 298, "k299": 299, "k300": 300, "k301": 301, "k302": 302, "k303": 303, "k304": 304, "k305": 305, "k306": 306, "k307": 307, "k308": 308, "k309": 309, "k310": 310, "k311": 311, "k312": 312, "k313": 313, "k314": 314, "k315": 315, "k316": 316, "k317": 317, "k318": 318, "k319": 319, "k320": 320, "k321": 321, "k322": 322, "k323": 323, "k324": 324, "k325": 325, "k326": 326, "k327": 327, "k328": 328, "k329": 329, "k330": 330, "k331": 331, "k332": 332, "k333": 333, "k334": 334, "k335": 335, "k336": 336, "k337": 337, "k338": 338, "k339": 339, "k340": 340, "k341": 341, "k342": 342, "k343": 343, "k344": 344, "k345": 345, "k346": 346, "k347": 347, "k348": 348, "k349": 349, "k350": 350, "k351": 351, "k352": 352, "k353": 353, "k354": 354, "k355": 355, "k356": 356, "k357": 357, "k358": 358, "k359": 359, "k360": 360, "k361": 361, "k362": 362, "k363": 363, "k364": 364, "k365": 365, "k366": 366, "k367": 367, "k368": 368, "k369": 369, "k370": 370, "k371": 371, "k372": 372, "k373": 373, "k374": 374, "k375": 375, "k376": 376, "k377": 377, "k378": 378, "k379": 379, "k380": 380, "k381": 381, "k382": 382, "k383": 383, "k384": 384, "k385": 385, "k386": 386, "k387": 387, "k388": 388, "k389": 389, "k390": 390, "k391": 391, "k392": 392, "k393": 393, "k394": 394, "k395": 395, "k396": 396, "k397": 397, "k398": 398, "k399": 399, "k400": 400, "k401": 401, "k402": 402, "k403": 403, "k404": 404, "k405": 405, "k406": 406, "k407": 407, "k408": 408, "k409": 409, "k410": 410, "k411": 411, "k412": 412, "k413": 413, "k414": 414, "k415": 415, "k416": 416, "k417": 417, "k418": 418, "k419": 419, "k420": 420, "k421": 421, "k422": 422, "k423": 423, "k424": 424, "k425": 425, "k426": 426, "k427": 427, "k428": 428, "k429": 429, "k430": 430, "k431": 431, "k432": 432, "k433": 433, "k434": 434, "k435": 435, "k436": 436, "k437": 437, "k438": 438, "k439": 439, "k440": 440, "k441": 441, "k442": 442, "k443": 443, "k444": 444, "k445": 445, "k446": 446, "k447": 447, "k448": 448, "k449": 449, "k450": 450, "k451": 451, "k452": 452, "k453": 453, "k454": 454, "k455": 455, "k456": 456, "k457": 457, "k458": 458, "k459": 459, "k460": 460, "k461": 461, "k462": 462, "k463": 463, "k464": 464, "k465": 465, "k466": 466, "k467": 467, "k468": 468, "k469": 469, "k470": 470, "k471": 471, "k472": 472, "k473": 473, "k474": 474, "k475": 475, "k476": 476, "k477": 477, "k478": 478, "k479": 479, "k480": 480, "k481": 481, "k482": 482, "k483": 483, "k484": 484, "k485": 485, "k486": 486, "k487": 487, "k488": 488, "k489": 489, "k490": 490, "k491": 491, "k492": 492, "k493": 493, "k494": 494, "k495": 495, "k496": 496, "k497": 497, "k498": 498, "k499": 499 } diff --git a/SOURCES/json-c-versioned-symbols.patch b/SOURCES/json-c-versioned-symbols.patch deleted file mode 100644 index a0951c4..0000000 --- a/SOURCES/json-c-versioned-symbols.patch +++ /dev/null @@ -1,165 +0,0 @@ -commit ca454c53a3f39fcd23d9a7d779f56fd06928ab4a -Author: Tomas Korbar -Date: Mon Sep 13 10:18:44 2021 +0200 - - Fix symbols - -diff --git a/json-c.sym b/json-c.sym -new file mode 100644 -index 0000000..bf78792 ---- /dev/null -+++ b/json-c.sym -@@ -0,0 +1,153 @@ -+JSONC_0.14 { -+ global: -+ _json_c_set_last_err; -+ _json_c_strerror; -+ _json_c_strerror_enable; -+ array_list_add; -+ array_list_bsearch; -+ array_list_del_idx; -+ array_list_free; -+ array_list_get_idx; -+ array_list_length; -+ array_list_new; -+ array_list_put_idx; -+ array_list_sort; -+ json_c_get_random_seed; -+ json_c_object_sizeof; -+ json_c_set_serialization_double_format; -+ json_c_shallow_copy_default; -+ json_c_version; -+ json_c_version_num; -+ json_c_visit; -+ json_global_set_string_hash; -+ json_hex_chars; -+ json_number_chars; -+ json_object_array_add; -+ json_object_array_bsearch; -+ json_object_array_del_idx; -+ json_object_array_get_idx; -+ json_object_array_length; -+ json_object_array_put_idx; -+ json_object_array_sort; -+ json_object_deep_copy; -+ json_object_double_to_json_string; -+ json_object_equal; -+ json_object_free_userdata; -+ json_object_from_fd; -+ json_object_from_fd_ex; -+ json_object_from_file; -+ json_object_get; -+ json_object_get_array; -+ json_object_get_boolean; -+ json_object_get_double; -+ json_object_get_int64; -+ json_object_get_int; -+ json_object_get_object; -+ json_object_get_string; -+ json_object_get_string_len; -+ json_object_get_type; -+ json_object_get_uint64; -+ json_object_get_userdata; -+ json_object_int_inc; -+ json_object_is_type; -+ json_object_iter_begin; -+ json_object_iter_end; -+ json_object_iter_equal; -+ json_object_iter_init_default; -+ json_object_iter_next; -+ json_object_iter_peek_name; -+ json_object_iter_peek_value; -+ json_object_new_array; -+ json_object_new_boolean; -+ json_object_new_double; -+ json_object_new_double_s; -+ json_object_new_int64; -+ json_object_new_int; -+ json_object_new_null; -+ json_object_new_object; -+ json_object_new_string; -+ json_object_new_string_len; -+ json_object_new_uint64; -+ json_object_object_add; -+ json_object_object_add_ex; -+ json_object_object_del; -+ json_object_object_get; -+ json_object_object_get_ex; -+ json_object_object_length; -+ json_object_put; -+ json_object_set_boolean; -+ json_object_set_double; -+ json_object_set_int64; -+ json_object_set_int; -+ json_object_set_serializer; -+ json_object_set_string; -+ json_object_set_string_len; -+ json_object_set_uint64; -+ json_object_set_userdata; -+ json_object_to_fd; -+ json_object_to_file; -+ json_object_to_file_ext; -+ json_object_to_json_string; -+ json_object_to_json_string_ext; -+ json_object_to_json_string_length; -+ json_object_userdata_to_json_string; -+ json_parse_double; -+ json_parse_int64; -+ json_parse_uint64; -+ json_pointer_get; -+ json_pointer_getf; -+ json_pointer_set; -+ json_pointer_setf; -+ json_tokener_error_desc; -+ json_tokener_free; -+ json_tokener_get_error; -+ json_tokener_get_parse_end; -+ json_tokener_new; -+ json_tokener_new_ex; -+ json_tokener_parse; -+ json_tokener_parse_ex; -+ json_tokener_parse_verbose; -+ json_tokener_reset; -+ json_tokener_set_flags; -+ json_type_to_name; -+ json_util_get_last_err; -+ lh_char_equal; -+ lh_kchar_table_new; -+ lh_kptr_table_new; -+ lh_ptr_equal; -+ lh_table_delete; -+ lh_table_delete_entry; -+ lh_table_free; -+ lh_table_insert; -+ lh_table_insert_w_hash; -+ lh_table_length; -+ lh_table_lookup; -+ lh_table_lookup_entry; -+ lh_table_lookup_entry_w_hash; -+ lh_table_lookup_ex; -+ lh_table_new; -+ lh_table_resize; -+ mc_debug; -+ mc_error; -+ mc_get_debug; -+ mc_info; -+ mc_set_debug; -+ mc_set_syslog; -+ printbuf_free; -+ printbuf_memappend; -+ printbuf_memset; -+ printbuf_new; -+ printbuf_reset; -+ sprintbuf; -+ -+ local: -+ *; -+}; -+ -+JSONC_0.15 { -+ global: -+ array_list_new2; -+ array_list_shrink; -+ json_object_array_shrink; -+ json_object_new_array_ext; -+} JSONC_0.14; diff --git a/SPECS/json-c.spec b/SPECS/json-c.spec deleted file mode 100644 index bca56c1..0000000 --- a/SPECS/json-c.spec +++ /dev/null @@ -1,322 +0,0 @@ -%{!?_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}} - -%global so_ver 4 -%global reldate 20180305 - -# Uncomment when building a bootstrap for a bumped so-name. -# You also need to adjust the parameters below. -%global bootstrap 0 - -%if 0%{?bootstrap} -%global reldate_old 20171207 -%global version_old 0.13 -%global so_ver_old 3 -%endif - - -Name: json-c -Version: 0.13.1 -Release: 3%{?dist} -Summary: JSON implementation in C - -License: MIT -URL: https://github.com/%{name}/%{name} -Source0: %{url}/archive/%{name}-%{version}-%{reldate}.tar.gz -%if 0%{?bootstrap} -Source1: %{url}/archive/%{name}-%{version_old}-%{reldate_old}.tar.gz -%endif -# CVE-2020-12762 json-c: integer overflow and out-of-bounds write via a large JSON file -# rhbz#1835626 -Patch0: json-c-int-overflow.patch -# patch for support of versioned symbols -# rhbz#2001063 -Patch1: json-c-versioned-symbols.patch - -BuildRequires: libtool - -%description -JSON-C implements a reference counting object model that allows you -to easily construct JSON objects in C, output them as JSON formatted -strings and parse JSON formatted strings back into the C representation -of JSON objects. It aims to conform to RFC 7159. - - -%package devel -Summary: Development files for %{name} - -Requires: %{name}%{?_isa} == %{version}-%{release} - -%description devel -This package contains libraries and header files for -developing applications that use %{name}. - - -%package doc -Summary: Reference manual for json-c - -BuildArch: noarch - -BuildRequires: doxygen -BuildRequires: hardlink - -%description doc -This package contains the reference manual for %{name}. - - -%prep -%autosetup -Tb 0 -n %{name}-%{name}-%{version}-%{reldate} -p 1 - -for doc in ChangeLog; do - %{_bindir}/iconv -f iso-8859-1 -t utf8 ${doc} > ${doc}.new - /bin/touch -r ${doc} ${doc}.new - %{__mv} -f ${doc}.new ${doc} -done - -%{__sed} -i -e 's!#ACLOCAL_AMFLAGS!ACLOCAL_AMFLAGS!g' Makefile.am -%{_bindir}/autoreconf -fiv - -%if 0%{?bootstrap} -%{__mkdir} -p bootstrap_ver -pushd bootstrap_ver -%{__tar} --strip-components=1 -xf %{SOURCE1} - -%{__sed} -i -e 's!#ACLOCAL_AMFLAGS!ACLOCAL_AMFLAGS!g' Makefile.am -%{_bindir}/autoreconf -fiv -popd -%endif - - -%build -# it is easier and more efficient to add version script flag -# here instead of having to rebuild the configure script -LDFLAGS="%{build_ldflags} -Wl,--version-script,${PWD}/json-c.sym" -%configure \ - --disable-silent-rules \ - --disable-static \ - --enable-shared \ - --enable-threading - -%make_build - -%{_bindir}/doxygen Doxyfile - -%if 0%{?bootstrap} -pushd bootstrap_ver -%configure \ - --disable-silent-rules \ - --disable-static \ - --enable-shared \ - --enable-threading - -%make_build -popd -%endif - - -%install -%if 0%{?bootstrap} -%make_install -C bootstrap_ver -%{__rm} -fr %{buildroot}%{_includedir}/%{name} \ - %{buildroot}%{_libdir}/lib%{name}.so \ - %{buildroot}%{_libdir}/pkgconfig -%endif - -%make_install - -%{_bindir}/find %{buildroot} -name '*.a' -delete -print -%{_bindir}/find %{buildroot} -name '*.la' -delete -print - -%{__mkdir} -p %{buildroot}%{_pkgdocdir} -%{__cp} -pr doc/html ChangeLog README README.* %{buildroot}%{_pkgdocdir} -%{_sbindir}/hardlink -cvf %{buildroot}%{_pkgdocdir} - - -%check -%make_build check - -%if 0%{?bootstrap} -%make_build -C bootstrap_ver check -%endif - - -%pretrans devel -p -path = "%{_includedir}/%{name}" -st = posix.stat(path) -if st and st.type == "link" then - os.remove(path) -end - - -%ldconfig_scriptlets - - -%files -%license AUTHORS -%license COPYING -%{_libdir}/lib%{name}.so.%{so_ver}* -%if 0%{?bootstrap} -%{_libdir}/lib%{name}.so.%{so_ver_old}* -%endif - - -%files devel -%doc %{_pkgdocdir}/ChangeLog -%doc %{_pkgdocdir}/README* -%{_includedir}/%{name}/ -%{_libdir}/lib%{name}.so -%{_libdir}/pkgconfig/%{name}.pc - - -%files doc -%if 0%{?fedora} || 0%{?rhel} >= 7 -%license %{_datadir}/licenses/%{name}* -%endif # 0%%{?fedora} || 0%%{?rhel} >= 7 -%doc %{_pkgdocdir} - - -%changelog -* Tue Sep 14 2021 Tomas Korbar - 0.13.1-3 -- Start versioning symbols when building library -- Resolves: rhbz#2001063 - -* Thu May 20 2021 Joe Orton - 0.13.1-2 -- rebuild (#1954436) - -* Thu Apr 15 2021 Tomas Korbar - 0.13.1-1 -- Fix CVE-2020-12762 out-of-bounds write via a large JSON file -- Resolves: rhbz#1835626 - -* Wed Feb 03 2021 Petr Menšík - 0.13.1-0.4 -- Move json-c-devel to AppStream - -* Fri Sep 18 2020 Anna Khaitovich - 0.13.1-0.3 -- Don't package empty /usr/share/doc/json-c -- Resolves: rhbz#1741076 -- Do not use --enable-rdrand -- Resolves: rhbz#1806532 - -* Fri Aug 03 2018 Radovan Sroka - 0.13.1-0.2 -- disable bootstrap for RHEL8 - -* Tue Mar 06 2018 Björn Esser - 0.13.1-0.1 -- Bootstrapping for so-name bump - -* Wed Feb 07 2018 Fedora Release Engineering - 0.13-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Fri Feb 02 2018 Igor Gnatenko - 0.13-6 -- Switch to %%ldconfig_scriptlets - -* Thu Dec 14 2017 Björn Esser - 0.13-5 -- Update patch fixing a segfault caused by possible invalid frees - -* Wed Dec 13 2017 Björn Esser - 0.13-4 -- Add upstream patch fixing invalid free in some cases - -* Wed Dec 13 2017 Björn Esser - 0.13-3 -- Add upstream patch for adding size_t json_c_object_sizeof() -- Enable partial multi-threaded support - -* Mon Dec 11 2017 Björn Esser - 0.13-2 -- Drop json_object_private.h - -* Mon Dec 11 2017 Björn Esser - 0.13-1 -- New upstream release (rhbz#1524155) - -* Sun Dec 10 2017 Björn Esser - 0.13-0.1 -- Bootstrapping for so-name bump -- Keep json_object_private.h - -* Thu Aug 03 2017 Fedora Release Engineering - 0.12.1-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild - -* Wed Jul 26 2017 Fedora Release Engineering - 0.12.1-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Mon Jul 03 2017 Björn Esser - 0.12.1-2 -- Add patch to replace obsolete autotools macro - -* Thu Apr 27 2017 Björn Esser - 0.12.1-1 -- Update to new upstream release -- Introduces SONAME bump, that should have been in 0.12 already -- Unify %%doc -- General spec-file cleanup - -* Fri Feb 10 2017 Fedora Release Engineering - 0.12-8 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - -* Thu Feb 04 2016 Fedora Release Engineering - 0.12-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild - -* Wed Jun 17 2015 Fedora Release Engineering - 0.12-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild - -* Sat Aug 16 2014 Fedora Release Engineering - 0.12-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild - -* Tue Jul 29 2014 Christopher Meng - 0.12-4 -- SONAME bump postponed. - -* Mon Jul 28 2014 Christopher Meng - 0.12-3 -- SONAME bump, see bug 1123785 - -* Fri Jul 25 2014 Christopher Meng - 0.12-2 -- NVR bump - -* Thu Jul 24 2014 Christopher Meng - 0.12-1 -- Update to 0.12 - -* Sat Jul 12 2014 Tom Callaway - 0.11-8 -- fix license handling - -* Sun Jun 08 2014 Fedora Release Engineering - 0.11-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild - -* Wed Apr 09 2014 Susi Lehtola - 0.11-7 -- Address CVE-2013-6371 and CVE-2013-6370 (BZ #1085676 and #1085677). -- Enabled rdrand support. - -* Mon Feb 10 2014 Susi Lehtola - 0.11-6 -- Bump spec. - -* Sat Dec 21 2013 Ville Skyttä - 0.11-5 -- Run test suite during build. -- Drop empty NEWS from docs. - -* Tue Sep 10 2013 Susi Lehtola - 0.11-4 -- Remove default warning flags so that package builds on EPEL as well. - -* Sat Aug 24 2013 Remi Collet - 0.11-3 -- increase parser strictness for php - -* Sat Aug 03 2013 Fedora Release Engineering - 0.11-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild - -* Mon Apr 29 2013 Remi Collet - 0.11-1 -- update to 0.11 -- fix source0 -- enable both json and json-c libraries - -* Thu Feb 14 2013 Fedora Release Engineering - 0.10-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild - -* Sat Nov 24 2012 Jussi Lehtola - 0.10-2 -- Compile and install json_object_iterator using Remi Collet's fix (BZ #879771). - -* Sat Nov 24 2012 Jussi Lehtola - 0.10-1 -- Update to 0.10 (BZ #879771). - -* Thu Jul 19 2012 Fedora Release Engineering - 0.9-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild - -* Mon Jan 23 2012 Jiri Pirko - 0.9-4 -- add json_tokener_parse_verbose, and return NULL on parser errors - -* Fri Jan 13 2012 Fedora Release Engineering - 0.9-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild - -* Wed Feb 09 2011 Fedora Release Engineering - 0.9-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild - -* Tue Apr 06 2010 Jussi Lehtola - 0.9-1 -- First release. diff --git a/json-c.spec b/json-c.spec new file mode 100644 index 0000000..ffeb01d --- /dev/null +++ b/json-c.spec @@ -0,0 +1,402 @@ +%{!?_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}} + +# We don't want accidental SONAME bumps. +# When there is a SONAME bump in json-c, we need to request +# a side-tag for bootstrap purposes: +# +# 1. Build a bootstrap build of the systemd package, and wait +# for it to be available inside the side-tag. +# 2. Re-build the following build-chain for bootstrap: +# json-c : cryptsetup +# 3. Untag the systemd bootstrap build from the side-tag, and +# disable bootstrapping in the systemd package. Re-build +# the systemd package into Rawhide. +# 4. Wait for the changes to populate and re-build the following +# chain into the side-tag: +# satyr : libdnf libreport +# 5. Merge the side-tag using Bodhi. +# +# After that procedure any other cosumers can be re-build +# in Rawhide as usual. +%global so_ver 5 + +# Releases are tagged with a date stamp. +%global reldate 20240915 + + +Name: json-c +Version: 0.18 +Release: 3%{?dist} +Summary: JSON implementation in C + +License: MIT +URL: https://github.com/%{name}/%{name} +Source0: %{url}/archive/%{name}-%{version}-%{reldate}.tar.gz + +BuildRequires: cmake +BuildRequires: gcc +BuildRequires: ninja-build +%ifarch %{valgrind_arches} +BuildRequires: valgrind +%endif + +%description +JSON-C implements a reference counting object model that allows you +to easily construct JSON objects in C, output them as JSON formatted +strings and parse JSON formatted strings back into the C representation +of JSON objects. It aims to conform to RFC 7159. + + +%package devel +Summary: Development files for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +This package contains libraries and header files for +developing applications that use %{name}. + + +%package doc +Summary: Reference manual for json-c + +#BuildArch: noarch + +BuildRequires: doxygen +BuildRequires: hardlink +Requires: %{name} = %{version}-%{release} + +%description doc +This package contains the reference manual for %{name}. + + +%prep +%autosetup -n %{name}-%{name}-%{version}-%{reldate} -p 1 + +# Remove pre-built html documentation. +rm -fr doc/html + +# Update Doxyfile. +doxygen -s -u doc/Doxyfile.in + + +%build +%cmake \ + -DBUILD_STATIC_LIBS:BOOL=OFF \ + -DCMAKE_BUILD_TYPE:STRING=RELEASE \ + -DCMAKE_C_FLAGS_RELEASE:STRING="" \ + -DDISABLE_BSYMBOLIC:BOOL=OFF \ + -DDISABLE_WERROR:BOOL=ON \ + -DENABLE_RDRAND:BOOL=ON \ + -DENABLE_THREADING:BOOL=ON \ + -G Ninja +%cmake_build --target all doc + + +%install +%cmake_install + +# Documentation +mkdir -p %{buildroot}%{_pkgdocdir} +cp -a %{__cmake_builddir}/doc/html ChangeLog README README.* \ + %{buildroot}%{_pkgdocdir} +hardlink -cfv %{buildroot}%{_pkgdocdir} + + +%check +export USE_VALGRIND=0 +%ctest +%ifarch %{valgrind_arches} +export USE_VALGRIND=1 +%ctest +%endif +unset USE_VALGRIND + + +%ldconfig_scriptlets + + +%files +%license AUTHORS +%license COPYING +%{_libdir}/lib%{name}.so.%{so_ver}* + + +%files devel +%doc %dir %{_pkgdocdir} +%doc %{_pkgdocdir}/ChangeLog +%doc %{_pkgdocdir}/README* +%{_includedir}/%{name} +%{_libdir}/cmake/%{name} +%{_libdir}/lib%{name}.so +%{_libdir}/pkgconfig/%{name}.pc + + +%files doc +%doc %{_pkgdocdir} +%exclude %{_pkgdocdir}/ChangeLog +%exclude %{_pkgdocdir}/README* + + +%changelog +* Wed Nov 06 2024 Tomas Korbar - 0.18-3 +- Improve fix of problem on upgrade of doc subpackage +- Related: RHEL-65629 + +* Tue Nov 05 2024 Tomas Korbar - 0.18-2 +- Fix problem on upgrade of doc subpackage +- Related: RHEL-65629 + +* Tue Nov 05 2024 Tomas Korbar - 0.18-1 +- Rebase to 0.18 +- Resolves: RHEL-65629 + +* Tue Oct 29 2024 Troy Dawson - 0.17-5 +- Bump release for October 2024 mass rebuild: + Resolves: RHEL-64018 + +* Mon Jun 24 2024 Troy Dawson - 0.17-4 +- Bump release for June 2024 mass rebuild + +* Wed Jan 24 2024 Fedora Release Engineering - 0.17-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sat Jan 20 2024 Fedora Release Engineering - 0.17-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sun Aug 13 2023 Björn Esser - 0.17-1 +- Update to 0.17 +- Fixes: rhbz#2231647 + +* Thu Jul 20 2023 Fedora Release Engineering - 0.16-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Thu Jan 19 2023 Fedora Release Engineering - 0.16-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Wed Nov 02 2022 Björn Esser - 0.16-3 +- Rebuilt for arc4random in glibc 2.36 (or later) + +* Thu Jul 21 2022 Fedora Release Engineering - 0.16-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Tue May 17 2022 Tomas Korbar - 0.16-1 +- Update to 0.16 +- Resolves: rhbz#2075376 + +* Thu Jan 20 2022 Fedora Release Engineering - 0.15-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Thu Jul 22 2021 Fedora Release Engineering - 0.15-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Thu Jul 08 2021 Björn Esser - 0.15-1 +- Update to 0.15 +- Backport several fixes from upstream commits +- Change doc package to be arched + +* Tue Jan 26 2021 Fedora Release Engineering - 0.14-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Mon Jul 27 2020 Björn Esser - 0.14-7 +- Use new cmake macros + +* Tue May 26 2020 Björn Esser - 0.14-6 +- Build using Ninja instead of Make +- Add a patch to move Doxyfile into doc subdir +- Remove pre-built html documentation +- Update Doxyfile during %%prep +- Add a patch to apply some optimizations to arraylist +- Hardlink the files in %%_pkgdocdir + +* Mon May 25 2020 Björn Esser - 0.14-5 +- Run the testssuite with valgrind on %%valgrind_arches + +* Mon May 18 2020 Björn Esser - 0.14-4 +- Add a patch to fix a test +- Add a patch to fix generation of user-documentation + +* Mon May 11 2020 Björn Esser - 0.14-3 +- Add upstream patch fixing usage of errno in json_parse_uint64() + +* Sun May 10 2020 Björn Esser - 0.14-2 +- Add a patch to backport fixes applied on upstream master branch +- Re-enable RDRAND as json-c can detect broken implementations in CPUs now +- Disable -Werror during build + +* Tue Apr 21 2020 Björn Esser - 0.14-1 +- Update to 0.14 + +* Mon Apr 20 2020 Björn Esser - 0.13.99-0.4.20200416gita911439 +- Remove config.h file from installation +- Drop hardlinking of the documentation files + +* Thu Apr 16 2020 Björn Esser - 0.13.99-0.3.20200416gita911439 +- Update to recent git snapshot + +* Tue Apr 14 2020 Björn Esser - 0.13.99-0.2.20200414git7fb8d56 +- Update to recent git snapshot + +* Tue Apr 14 2020 Björn Esser - 0.13.99-0.1.20200414gitab5425a +- Update to recent git snapshot using forge macros + +* Sun Apr 12 2020 Björn Esser - 0.13.1-11 +- Drop bootstrap logic, as the package is no dependency of @build anymore +- Add some explicit BuildRequires, which were implicit +- Small spec file cleanups + +* Sat Apr 11 2020 Björn Esser - 0.13.1-10 +- Add explicit configure switch to disable rdrand +- Add explicit configure switch to enable linking with Bsymbolic +- Do not use macros to invoke executables +- Drop obsolete %%pretrans scriptlet + +* Wed Jan 29 2020 Fedora Release Engineering - 0.13.1-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Thu Nov 28 2019 Petr Menšík - 0.13.1-8 +- Remove empty doc dir from library package + +* Wed Nov 06 2019 Miroslav Lichvar 0.13.1-7 +- Disable rdrand support (#1745333) + +* Thu Jul 25 2019 Fedora Release Engineering - 0.13.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Wed Jun 26 2019 Björn Esser - 0.13.1-5 +- Use hardlink without full path to the binary (#1721964) +- Use new style bootstrap logic + +* Fri Feb 01 2019 Fedora Release Engineering - 0.13.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Fri Jul 13 2018 Fedora Release Engineering - 0.13.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Tue May 08 2018 Björn Esser - 0.13.1-2 +- Add some cherry-picked fixes from upstream master + +* Tue Mar 06 2018 Björn Esser - 0.13.1-1 +- New upstream release (rhbz#1552053) + +* Tue Mar 06 2018 Björn Esser - 0.13.1-0.1 +- Bootstrapping for so-name bump + +* Wed Feb 07 2018 Fedora Release Engineering - 0.13-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Fri Feb 02 2018 Igor Gnatenko - 0.13-6 +- Switch to %%ldconfig_scriptlets + +* Thu Dec 14 2017 Björn Esser - 0.13-5 +- Update patch fixing a segfault caused by possible invalid frees + +* Wed Dec 13 2017 Björn Esser - 0.13-4 +- Add upstream patch fixing invalid free in some cases + +* Wed Dec 13 2017 Björn Esser - 0.13-3 +- Add upstream patch for adding size_t json_c_object_sizeof() +- Enable partial multi-threaded support + +* Mon Dec 11 2017 Björn Esser - 0.13-2 +- Drop json_object_private.h + +* Mon Dec 11 2017 Björn Esser - 0.13-1 +- New upstream release (rhbz#1524155) + +* Sun Dec 10 2017 Björn Esser - 0.13-0.1 +- Bootstrapping for so-name bump +- Keep json_object_private.h + +* Thu Aug 03 2017 Fedora Release Engineering - 0.12.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 0.12.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Mon Jul 03 2017 Björn Esser - 0.12.1-2 +- Add patch to replace obsolete autotools macro + +* Thu Apr 27 2017 Björn Esser - 0.12.1-1 +- Update to new upstream release +- Introduces SONAME bump, that should have been in 0.12 already +- Unify %%doc +- General spec-file cleanup + +* Fri Feb 10 2017 Fedora Release Engineering - 0.12-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Feb 04 2016 Fedora Release Engineering - 0.12-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jun 17 2015 Fedora Release Engineering - 0.12-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sat Aug 16 2014 Fedora Release Engineering - 0.12-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Tue Jul 29 2014 Christopher Meng - 0.12-4 +- SONAME bump postponed. + +* Mon Jul 28 2014 Christopher Meng - 0.12-3 +- SONAME bump, see bug 1123785 + +* Fri Jul 25 2014 Christopher Meng - 0.12-2 +- NVR bump + +* Thu Jul 24 2014 Christopher Meng - 0.12-1 +- Update to 0.12 + +* Sat Jul 12 2014 Tom Callaway - 0.11-8 +- fix license handling + +* Sun Jun 08 2014 Fedora Release Engineering - 0.11-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Wed Apr 09 2014 Susi Lehtola - 0.11-7 +- Address CVE-2013-6371 and CVE-2013-6370 (BZ #1085676 and #1085677). +- Enabled rdrand support. + +* Mon Feb 10 2014 Susi Lehtola - 0.11-6 +- Bump spec. + +* Sat Dec 21 2013 Ville Skyttä - 0.11-5 +- Run test suite during build. +- Drop empty NEWS from docs. + +* Tue Sep 10 2013 Susi Lehtola - 0.11-4 +- Remove default warning flags so that package builds on EPEL as well. + +* Sat Aug 24 2013 Remi Collet - 0.11-3 +- increase parser strictness for php + +* Sat Aug 03 2013 Fedora Release Engineering - 0.11-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Mon Apr 29 2013 Remi Collet - 0.11-1 +- update to 0.11 +- fix source0 +- enable both json and json-c libraries + +* Thu Feb 14 2013 Fedora Release Engineering - 0.10-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Sat Nov 24 2012 Jussi Lehtola - 0.10-2 +- Compile and install json_object_iterator using Remi Collet's fix (BZ #879771). + +* Sat Nov 24 2012 Jussi Lehtola - 0.10-1 +- Update to 0.10 (BZ #879771). + +* Thu Jul 19 2012 Fedora Release Engineering - 0.9-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Mon Jan 23 2012 Jiri Pirko - 0.9-4 +- add json_tokener_parse_verbose, and return NULL on parser errors + +* Fri Jan 13 2012 Fedora Release Engineering - 0.9-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Wed Feb 09 2011 Fedora Release Engineering - 0.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Tue Apr 06 2010 Jussi Lehtola - 0.9-1 +- First release. diff --git a/sources b/sources new file mode 100644 index 0000000..f506956 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (json-c-0.18-20240915.tar.gz) = 219d8c0da9a4016b74af238cc15dbec1f369a07de160bcc548d80279028e1b5d8d928deb13fec09c96a085fc0ecf10090e309cbe72d0081aca864433c4ae01db