1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-31 20:26:40 +00:00

document follow_symlinks requirements, check libc, fixes #2507

This commit is contained in:
Thomas Waldmann 2017-05-18 02:02:51 +02:00
parent 58791583d9
commit b484c79bc2
3 changed files with 27 additions and 1 deletions

View file

@ -54,6 +54,21 @@ manages data.
.. _locking: https://en.wikipedia.org/wiki/File_locking#Lock_files
(G)LIBC requirements
--------------------
Borg uses some filesytem functions from Python's `os` standard library module
with `follow_symlinks=False`. These are implemented since quite a while with
the non-symlink-following (g)libc functions like e.g. `lstat` or `lutimes`
(not: `stat` or `utimes`).
Some stoneage systems (like RHEL/CentOS 5) and also Python interpreter binaries
compiled to be able to run on such systems (like Python installed via Anaconda)
might miss these functions and Borg won't be able to work correctly.
This issue will be detected early and Borg will abort with a fatal error.
For the Borg binaries, there are additional (g)libc requirements, see below.
.. _distribution-package:
Distribution Package

View file

@ -54,7 +54,7 @@
from .helpers import Manifest
from .helpers import hardlinkable
from .helpers import StableDict
from .helpers import check_extension_modules
from .helpers import check_python, check_extension_modules
from .helpers import dir_is_tagged, is_slow_msgpack, yes, sysinfo
from .helpers import log_multi
from .helpers import signal_handler, raising_signal_handler, SigHup, SigTerm
@ -3829,6 +3829,7 @@ def parse_args(self, args=None):
return args
def prerun_checks(self, logger):
check_python()
check_extension_modules()
selftest(logger)

View file

@ -114,6 +114,16 @@ class InvalidPlaceholder(PlaceholderError):
"""Invalid placeholder "{}" in string: {}"""
class PythonLibcTooOld(Error):
"""FATAL: this Python was compiled for a too old (g)libc and misses required functionality."""
def check_python():
required_funcs = {os.stat, os.utime}
if not os.supports_follow_symlinks.issuperset(required_funcs):
raise PythonLibcTooOld
def check_extension_modules():
from . import platform, compress, item
if hashindex.API_VERSION != '1.1_01':