diff --git a/docs/changes.rst b/docs/changes.rst index f27bc8a9f..a74626bfa 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -163,6 +163,8 @@ New features: - export-tar/import-tar: support for POSIX ACLs (PAX format) - list --format: add "inode" placeholder - improved tty-less progress reporting (--progress), #9055 +- BORG_MSGPACK_VERSION_CHECK=no to optionally disable the msgpack version + check; default is "yes", use at your own risk, #9109. Fixes: @@ -888,6 +890,7 @@ New features: borg serve --socket # server side (not started automatically!) borg -r socket:///path/to/repo ... # client side + - add get_runtime_dir / BORG_RUNTIME_DIR (contains e.g. .sock and .pid file) - support shell-style alternatives, like: sh:image.{png,jpg}, #7602 diff --git a/docs/usage/general/environment.rst.inc b/docs/usage/general/environment.rst.inc index 424c89f02..670a6403d 100644 --- a/docs/usage/general/environment.rst.inc +++ b/docs/usage/general/environment.rst.inc @@ -78,6 +78,11 @@ General: When set to no (default: yes), system information (like OS, Python version, ...) in exceptions is not shown. Please only use for good reasons as it makes issues harder to analyze. + BORG_MSGPACK_VERSION_CHECK + Controls whether Borg checks the ``msgpack`` version. + The default is ``yes`` (strict check). Set to ``no`` to disable the version check and + allow any installed ``msgpack`` version. Use this at your own risk; malfunctioning or + incompatible ``msgpack`` versions may cause subtle bugs or repository data corruption. BORG_FUSE_IMPL Choose the low-level FUSE implementation borg shall use for ``borg mount``. This is a comma-separated list of implementation names, they are tried in the diff --git a/src/borg/helpers/msgpack.py b/src/borg/helpers/msgpack.py index 8f00a9772..bbbb22b86 100644 --- a/src/borg/helpers/msgpack.py +++ b/src/borg/helpers/msgpack.py @@ -46,6 +46,8 @@ Current behavior in msgpack terms - unpacks bin to bytes and raw to str (thus we need to convert to desired type if we want bytes from "raw") """ +import os + from .datastruct import StableDict from ..constants import * # NOQA @@ -206,8 +208,14 @@ def is_slow_msgpack(): def is_supported_msgpack(): # DO NOT CHANGE OR REMOVE! See also requirements and comments in pyproject.toml. + # This function now also respects the env var BORG_MSGPACK_VERSION_CHECK. + # Set BORG_MSGPACK_VERSION_CHECK=no to disable the version check at your own risk. import msgpack + version_check = os.environ.get("BORG_MSGPACK_VERSION_CHECK", "yes").strip().lower() + if version_check == "no": + return True + if msgpack.version in []: # < add bad releases here to deny list return False return (1, 0, 3) <= msgpack.version[:3] <= (1, 1, 2)