Commit graph

2041 commits

Author SHA1 Message Date
Vladimir Malinovskii
a8777e912a changed log message reserved length (40->44) 2024-04-06 01:31:00 +03:00
TW
00fd3708ac
Merge pull request #8167 from ThomasWaldmann/debounce-sigint-1.4
fix Ctrl-C / SIGINT behaviour for pyinstaller-made binaries, fixes #8155
2024-03-30 19:32:39 +01:00
TW
5ad7364209
Merge pull request #8125 from ThomasWaldmann/acl-error-handling-1.4
improve acl_get / acl_set error handling (1.4-maint)
2024-03-30 17:56:16 +01:00
Thomas Waldmann
dfb8d2054e
fix Ctrl-C / SIGINT behaviour for pyinstaller-made binaries, fixes #8155 2024-03-30 17:47:39 +01:00
Thomas Waldmann
262d6109a9
upgrade --check-tam: check manifest TAM auth issues
exit with rc=1 if there are issues.
2024-03-28 14:46:56 +01:00
Thomas Waldmann
69a4ea7682
upgrade: auto-use ignore_invalid_archive_tam 2024-03-28 14:46:34 +01:00
Thomas Waldmann
ed80bf2c37
do a late lookup on helpers.workarounds
so we can modify it within borg code elsewhere and it
will get the updated value when it accesses the attribute.
2024-03-28 14:44:38 +01:00
Thomas Waldmann
8643576755
upgrade --check-archives-tam: rc=1 for archive TAM issues
also: better messages about global status.
2024-03-28 14:44:25 +01:00
Thomas Waldmann
965c87bb0a
upgrade --check-archives-tam: check archives tam status
This is a read-only variation of --archives-tam:
- it only checks / displays the current status
- it does not add / fix the archive TAMs
2024-03-28 14:44:00 +01:00
Thomas Waldmann
7ba843b8c0
Linux: refactor acl_get 2024-03-17 18:51:08 +01:00
Thomas Waldmann
54c7da3c64
Linux: acl tests: move ACCESS_ACL and DEFAULT_ACL constants
They are only used at one place, move them there rather than having globals.
2024-03-17 18:51:07 +01:00
Thomas Waldmann
b45f572a95
FreeBSD: check first if kind of ACL can be set on a file 2024-03-17 18:51:06 +01:00
Thomas Waldmann
47e291eec1
FreeBSD: simplify numeric_ids check 2024-03-17 18:51:04 +01:00
Thomas Waldmann
b0607909e1
FreeBSD: added tests, only get default ACL from dirs 2024-03-17 18:51:03 +01:00
Thomas Waldmann
f8e8608488
FreeBSD: acl_get: raise OSError if lpathconf fails
Previously:
- acl_get just returned for lpathconf returning EINVAL
- acl_get silently ignored all other lpathconf errors and
  implied it is not a NFS4 acl

Now:
- not sure why the EINVAL silent return was done, but it seems
  wrong. guess it could be the system not implementing a check
  for nfs4. but in that case guess we still would like to get
  the default and access ACL!? Thus, I removed the silent return.
- raise OSError for all lpathconf errors

Cosmetic: add a nfs4_acl boolean, so the code reads better.
2024-03-17 18:50:58 +01:00
Thomas Waldmann
9d638e8d62
FreeBSD: acl_get: add an acl_extended_* call
... to implement same semantics as on linux (only store ACL
if it defines permissions other than those defined by the
traditional file permissions).

Looks like there is no call working with an fd on FreeBSD.
2024-03-17 18:50:55 +01:00
Thomas Waldmann
6ad1ad67d5
Linux: acl_set bug fix: always fsencode path
We use path when raising OSErrors, even if we have an fd.
2024-03-17 18:50:54 +01:00
Thomas Waldmann
17e3cee604
Linux: acl_get: use "nofollow" variant of acl_extended_file call
This is NOT a bug fix, because the previous code contained a
check for symlinks before that line - because symlinks can not
have ACLs under Linux.

Now, this "is it a symlink" check is removed to simplify the
code and the "nofollow" variant of acl_extended_file* is used
to look at the symlink fs object (in the symlink case).

It then should tell us that this does NOT have an extended ACL
(because symlinks can't have ACLs) and so we return there.

Overall the code gets simpler and looks less suspect.
2024-03-17 18:50:53 +01:00
Thomas Waldmann
519e3ebce8
Linux: acl_get: raise OSError for errors in acl_extended_* call
Previously, these conditions were handled the same (just return):
- no extended acl here
- some error happened (e.g. ACLs unsupported, bad file descriptor, file not found, permission error, ...)

Now there will be OSErrors for the error cases.
2024-03-17 18:50:49 +01:00
Thomas Waldmann
33f1ba699e
create/extract: ignore OSError if ACLs are not supported (ENOTSUP)
but do not silence other OSErrors.
2024-03-17 18:49:37 +01:00
Thomas Waldmann
d870c58e61
platform tests: misc. minor cleanups
- remove unused global / import
- use is_linux and is_darwin
- rename darwin acl test method
2024-03-16 15:58:50 +01:00
Thomas Waldmann
926b5a6b08
improve are_acls_working function
- ACLs are not working, if ENOTSUP ("Operation not supported") happens
- fix check for macOS
  On macOS borg uses "acl_extended", not "acl_access" and
  also the ACL text format is a bit different.
2024-03-16 15:56:58 +01:00
Thomas Waldmann
2c53a63a1c
raise OSError if acl_to_text / acl_from_text returns NULL
Also did a small structural refactors there.
2024-03-16 15:56:57 +01:00
Thomas Waldmann
d4a83edfdd
improve acl_get / acl_set error handling, see #4049 2024-03-16 15:56:55 +01:00
Thomas Waldmann
0151c9a38f
allow msgpack 1.0.8, fixes #8133 2024-03-02 14:19:11 +01:00
Thomas Waldmann
a88c3d9e25
create: deal with EBUSY, fixes #8123
I put it into same class as EPERM and EACCES:
BackupPermissionError: borg is not permitted to access the file.
2024-02-25 11:21:44 +01:00
TW
4522c040f3
Merge pull request #8117 from ThomasWaldmann/remove-bundled-3rd-party-1.4
Remove bundled 3rd party sw (1.4-maint)
2024-02-24 19:38:29 +01:00
Thomas Waldmann
5a8a505046
benchmark: inherit options --rsh --remote-path, fixes #8099 2024-02-22 21:35:11 +01:00
Thomas Waldmann
30dc27b11a
remove bundled lz4/zstd/xxhash code
Also adapt our Cython code to directly use the lib headers,
remove our wrappers.
2024-02-22 13:48:51 +01:00
Thomas Waldmann
420ef45f63
fix: Error/CommandError have a output format for 1 argument
(backport from master, only thing todo here was that one place)
2024-02-20 04:23:02 +01:00
Thomas Waldmann
97fe48c44c
check: fix return code for index entry value discrepancies
Also: use ERROR loglevel for these (not WARNING).

A different amount of index entries was already logged as error
and led to "error_found = True" in repository.check.

Different values in the rebuilt index vs. the on-disk index were
only logged on warning level, but did not lead to error_found = True.

Guess there is no reason why these should not be errors and lead to
error_found = True, so this was fixed in this commit.

Minor related change: change report_error function args, so it can be
called like logger.error - including giving a format AND args.
2024-02-08 19:31:24 +01:00
Thomas Waldmann
fb44fb5011
init: better borg key export instructions 2024-02-01 12:55:31 +01:00
Thomas Waldmann
f2b3a3a383
init: remove compatibility warning for borg <=1.0.8
The warning refers to a compatibility issue not relevant any
more since borg 1.0.9 (released 2016-12).

It is now better to remove this warning to make the output
of borg init shorter and maybe get more people to completely
read the important parts of it.
2024-01-31 17:26:20 +01:00
Thomas Waldmann
5b96d5acc3
create: add the slashdot hack, fixes #4685 2024-01-30 14:01:40 +01:00
TW
e0de99307a
Merge pull request #8066 from ThomasWaldmann/upgrade-bundled-code-1.4
Upgrade bundled code (1.4-maint)
2024-01-30 00:37:24 +01:00
Thomas Waldmann
b1a8924c0e
upgrade bundled zstd to 1.5.5 2024-01-29 22:30:04 +01:00
Thomas Waldmann
c8007e45ce
upgrade bundled xxhash to 0.8.2 2024-01-29 22:07:39 +01:00
Thomas Waldmann
a3998d0663
upgrade bundled lz4 to 1.9.4 2024-01-29 21:54:49 +01:00
Thomas Waldmann
e80d922730
requirements are defined in pyproject.toml 2024-01-29 20:44:37 +01:00
Thomas Waldmann
5d956b9655
add ConnectionBrokenWithHint for BrokenPipeErrors and similar, see #7016
no traceback, but error message and specific exit code.
2024-01-19 18:38:07 +01:00
Thomas Waldmann
45f65f7c57
check_can_create_repository: deal with PermissionErrors, see #7016
borg init calls this. If there is a PermissionError, it is
usually fs permission issue at path or its parent directory.

Don't give a traceback, but rather an error msg and a specific exit code.
2024-01-19 18:13:53 +01:00
Thomas Waldmann
8d72927e77
implement "borg version", fixes #7829
Additional new command "borg version <REPO>" which shows client and server version.
2024-01-19 13:01:14 +01:00
TW
319441e75d
Merge pull request #8051 from ThomasWaldmann/corrupted-key-errmsg-1.4
better error msg for corrupted key data, fixes #8016
2024-01-19 00:45:59 +01:00
Thomas Waldmann
dbbccf9451
better error msg for corrupted key data, fixes #8016 2024-01-18 23:59:35 +01:00
Thomas Waldmann
98fa922904
bump api version to 1.4 2024-01-18 20:09:49 +01:00
Thomas Waldmann
742bd0c097
refactor: use less binascii
our own hex_to_bin / bin_to_hex is more comfortable to use.

also: optimize remaining binascii usage / imports.
2024-01-18 18:13:40 +01:00
Thomas Waldmann
d9132a34d4
give clean error msg for invalid nonce file, see #7967
That rather long traceback was not pretty.

Of course users should usually have valid nonce files,
but multiple users managed to corrupt the file contents somehow.

Also:
- add Error / ErrorWithTraceback exception classes to RPC layer.
- add hex_to_bin helper
- also call hex_to_bin for the local nonce file (security dir)
2024-01-17 15:31:03 +01:00
Thomas Waldmann
884668ee07
borg.logger: use same method params as python logging 2024-01-14 00:07:05 +01:00
Thomas Waldmann
c2e7b7cc96
fix CommandError args, fixes 8029 2024-01-07 19:47:50 +01:00
TW
2812f992b8
Merge pull request #8032 from kmille/1.4-maint
improve docs for borg with-lock, 1.4-maint backport
2024-01-07 19:08:40 +01:00