borgbackup-1.4.4 has been released, which fixes a memory leak. Overview on changes can be found at [0].
I cherry-picked [1] to ensure that this update does not crash on big endian arches. The latter is caused by missing _le32toh() calls. Run tested on amd64. It would be helpful if someone can test this update on a big endian arch. Comments/OK? Any interest in having this is -stable? [0] https://borgbackup.readthedocs.io/en/1.4.4/changes.html#version-1-4-4-2026-03-19 [1] https://github.com/borgbackup/borg/pull/9522 diff --git Makefile Makefile index 5c1318b6bdf..6dab0991e14 100644 --- Makefile +++ Makefile @@ -1,5 +1,5 @@ MODULES = lang/python -MODPY_DISTV = 1.4.3 +MODPY_DISTV = 1.4.4 WANTLIB = crypto diff --git distinfo distinfo index e7ead607839..7ee2cd13eb9 100644 --- distinfo +++ distinfo @@ -1,2 +1,2 @@ -SHA256 (borgbackup-1.4.3.tar.gz) = ebv6dF0ZAdaFlzWEvS0Wo1Bobd0Xb2oiREkPsBmWRB8= -SIZE (borgbackup-1.4.3.tar.gz) = 4014143 +SHA256 (borgbackup-1.4.4.tar.gz) = Jxa8EkokkI78rJQ23zG3FtHwu9gorTmxj3O/3XcqZRo= +SIZE (borgbackup-1.4.4.tar.gz) = 3995698 diff --git patches/patch-src_borg__hashindex_c patches/patch-src_borg__hashindex_c new file mode 100644 index 00000000000..a3a6de58e67 --- /dev/null +++ patches/patch-src_borg__hashindex_c @@ -0,0 +1,48 @@ +Fix checks for big endian archs. Taken from +https://github.com/borgbackup/borg/pull/9522 + +Index: src/borg/_hashindex.c +--- src/borg/_hashindex.c.orig ++++ src/borg/_hashindex.c +@@ -371,6 +371,9 @@ hashindex_read(PyObject *file_py, int permit_compact, + } + + // check if key / value sizes match the expected sizes. ++ int header_num_buckets = _le32toh(header->num_buckets); ++ int header_num_entries = _le32toh(header->num_entries); ++ + if (expected_key_size != -1 && header->key_size != expected_key_size) { + PyErr_Format(PyExc_ValueError, "Expected key size %d, got %d.", + expected_key_size, header->key_size); +@@ -391,24 +394,24 @@ hashindex_read(PyObject *file_py, int permit_compact, + goto fail_decref_header; + } + // sanity check for num_buckets and num_entries. +- if (header->num_buckets < 1) { +- PyErr_Format(PyExc_ValueError, "Expected num_buckets >= 1, got %d.", header->num_buckets); ++ if (header_num_buckets < 1) { ++ PyErr_Format(PyExc_ValueError, "Expected num_buckets >= 1, got %d.", header_num_buckets); + goto fail_decref_header; + } +- if ((header->num_entries < 0) || (header->num_entries > header->num_buckets)) { +- PyErr_Format(PyExc_ValueError, "Expected 0 <= num_entries <= num_buckets, got %d.", header->num_entries); ++ if ((header_num_entries < 0) || (header_num_entries > header_num_buckets)) { ++ PyErr_Format(PyExc_ValueError, "Expected 0 <= num_entries <= num_buckets, got %d.", header_num_entries); + goto fail_decref_header; + } + +- buckets_length = (Py_ssize_t)_le32toh(header->num_buckets) * (header->key_size + header->value_size); ++ buckets_length = (Py_ssize_t)header_num_buckets * (header->key_size + header->value_size); + if((Py_ssize_t)length != (Py_ssize_t)sizeof(HashHeader) + buckets_length) { + PyErr_Format(PyExc_ValueError, "Incorrect file length (expected %zd, got %zd)", + sizeof(HashHeader) + buckets_length, length); + goto fail_release_header_buffer; + } + +- index->num_entries = _le32toh(header->num_entries); +- index->num_buckets = _le32toh(header->num_buckets); ++ index->num_entries = header_num_entries; ++ index->num_buckets = header_num_buckets; + index->key_size = header->key_size; + index->value_size = header->value_size; + index->bucket_size = index->key_size + index->value_size; diff --git pkg/PLIST pkg/PLIST index ff6dfd67ad2..fc4e668af97 100644 --- pkg/PLIST +++ pkg/PLIST @@ -184,8 +184,8 @@ lib/python${MODPY_VERSION}/site-packages/borg/testsuite/${MODPY_PYCACHE}file_int lib/python${MODPY_VERSION}/site-packages/borg/testsuite/${MODPY_PYCACHE}file_integrity.${MODPY_PYC_MAGIC_TAG}pyc lib/python${MODPY_VERSION}/site-packages/borg/testsuite/${MODPY_PYCACHE}hashindex.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION} lib/python${MODPY_VERSION}/site-packages/borg/testsuite/${MODPY_PYCACHE}hashindex.${MODPY_PYC_MAGIC_TAG}pyc -lib/python${MODPY_VERSION}/site-packages/borg/testsuite/${MODPY_PYCACHE}hashindex_stress.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION} -lib/python${MODPY_VERSION}/site-packages/borg/testsuite/${MODPY_PYCACHE}hashindex_stress.${MODPY_PYC_MAGIC_TAG}pyc +lib/python${MODPY_VERSION}/site-packages/borg/testsuite/${MODPY_PYCACHE}hashindex_pytest.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION} +lib/python${MODPY_VERSION}/site-packages/borg/testsuite/${MODPY_PYCACHE}hashindex_pytest.${MODPY_PYC_MAGIC_TAG}pyc lib/python${MODPY_VERSION}/site-packages/borg/testsuite/${MODPY_PYCACHE}helpers.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION} lib/python${MODPY_VERSION}/site-packages/borg/testsuite/${MODPY_PYCACHE}helpers.${MODPY_PYC_MAGIC_TAG}pyc lib/python${MODPY_VERSION}/site-packages/borg/testsuite/${MODPY_PYCACHE}issue_8535.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION} @@ -235,7 +235,7 @@ lib/python${MODPY_VERSION}/site-packages/borg/testsuite/crypto.py lib/python${MODPY_VERSION}/site-packages/borg/testsuite/efficient_collection_queue.py lib/python${MODPY_VERSION}/site-packages/borg/testsuite/file_integrity.py lib/python${MODPY_VERSION}/site-packages/borg/testsuite/hashindex.py -lib/python${MODPY_VERSION}/site-packages/borg/testsuite/hashindex_stress.py +lib/python${MODPY_VERSION}/site-packages/borg/testsuite/hashindex_pytest.py lib/python${MODPY_VERSION}/site-packages/borg/testsuite/helpers.py lib/python${MODPY_VERSION}/site-packages/borg/testsuite/issue_8535.py lib/python${MODPY_VERSION}/site-packages/borg/testsuite/item.py
