Commit Graph

31 Commits

Author SHA1 Message Date
Thomas Waldmann 64b7b5fdd4
FreeBSD: check first if kind of ACL can be set on a file 2024-04-02 01:38:30 +02:00
Thomas Waldmann 4ebb5cdf3c
FreeBSD: simplify numeric_ids check 2024-04-02 01:38:28 +02:00
Thomas Waldmann 7df170c946
FreeBSD: added tests, only get default ACL from dirs 2024-04-02 01:38:27 +02:00
Thomas Waldmann d3694271eb
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-04-02 01:38:26 +02:00
Thomas Waldmann 30f4518058
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-04-02 01:38:24 +02:00
Thomas Waldmann b3554cdc0f
raise OSError if acl_to_text / acl_from_text returns NULL
Also did a small structural refactors there.
2024-04-02 01:38:14 +02:00
Thomas Waldmann a75945ed0d
improve acl_get / acl_set error handling, see #4049 2024-04-02 01:38:12 +02:00
Thomas Waldmann 88231a2f64
xattrs: fix namespace processing on FreeBSD, fixes #6997 2023-03-13 11:14:07 +01:00
Thomas Waldmann 3280603e43 acls cleanup (linux), #6908
https://github.com/borgbackup/borg/issues/6908#issuecomment-1224872992

also:
- added some type assertions
- made NULL pointer checks more explicit
- fsencode only called when needed
- structure of code more similar now on all OSes
2022-09-14 13:57:40 +02:00
Thomas Waldmann 6f9b9e5a53 s/numeric_owner/numeric_ids/g 2021-04-16 15:02:16 +02:00
Thomas Waldmann f66c102cc5 bump platform api version 2019-03-18 21:51:02 +01:00
Thomas Waldmann 0686237484 make freebsd xattr platform code api compatible with linux, fixes #3952
i.e. prefix the keys with the namespace, so it is ns.key like on
linux.

still only dealing with the "user" namespace, like before.
in the "system" namespaces there are ACLs (we deal with them via the acl
api, so no problem) and stuff from pnfsd (not sure what exactly).

this change is needed because FreeBSD's FUSE code expects the xattr
keys to be in that format.

it is also needed for cross-platform data exchange, so e.g. if one wants to:
- create archive on linux, extract on freebsd - with "user.xxx" xattrs.
- or vice versa.

archives made with older borg versions on freebsd will still extract correctly
on freebsd (not on linux though) even though they do not have the
namespace prefixes in the archived metadata (it will be interpreted in
same way as if they were prefixed by "user." as we do not support any
other namespace anyway).

they do not have "
2019-03-18 21:40:46 +01:00
Thomas Waldmann a65cefb7bb bump API_VERSIONs to 1.2_xx 2019-02-24 19:45:41 +01:00
Thomas Waldmann a9d562de17 work around some Microsoft WSL issues
see there:

https://github.com/borgbackup/borg/issues/1961

and especially there (not implemented sync_file_range):

https://github.com/Microsoft/WSL/issues/645
2019-02-05 15:15:50 +01:00
Emmo Emminghaus b997d5ba5b move code from borg.helpers.usergroup to borg.platform.posix 2018-11-10 21:43:45 +01:00
Thomas Waldmann 44b4f9645d xattrs: use follow_symlinks=False as default, more tests
it's like we do it everywhere else because this is what we usually need.
2018-07-08 15:08:01 +02:00
Thomas Waldmann 7e47e68e29 acls: use fd instead of path 2018-07-07 17:02:37 +02:00
Thomas Waldmann 5bf5f12be1 acls: only calls os.fsencode for str paths 2018-07-07 16:54:19 +02:00
Thomas Waldmann 9deb90db71 xattr: use bytes typed names for listxattr, getxattr, setxattr 2018-07-07 15:47:56 +02:00
Thomas Waldmann b5a9ac5682 xattr: use bytes typed values for listattr, getxattr, setxattr
- getxattr should only return bytes, not None
- setxattr should not get a None value, just bytes
- remove unneeded tmp vars
2018-07-07 15:47:56 +02:00
Thomas Waldmann 99149684bf xattr: move to platform package, use cython, fixes #2495
this code used to live in borg.xattr and used ctypes
(and was the only ctypes-using code in borg).

the low level code now was converted to cython and
the platform code moved to platform package.

got rid of the code that tried to find the libc.
2018-07-07 15:47:56 +02:00
Thomas Waldmann b76661ab67 acl platform code: fix acl set return type (master) 2018-07-05 22:56:54 +02:00
Thomas Waldmann b419098fa4 make swidth available on all posix platforms, fixes #2667
it is assumed that posix == everything else than win32.
2018-06-12 21:25:17 +02:00
Thomas Waldmann 5e4df7782b refactor/move hostname/fqdn related funcs, see #3471
- move stuff to platform.base (should be platform independent according
  to the docs).
- bump platform API version
- parseformat: import fqdn from platform instead of recomputing it

This is not yet fixing #3471, just a preparation for it.
2017-12-24 04:12:02 +01:00
Thomas Waldmann 6f94949a36 migrate locks to child PID when daemonize is used
also:

increase platform api version due to change in get_process_id behaviour.
2017-08-08 03:46:44 +02:00
Marian Beermann 2fe37dba7f umount: try fusermount, then try umount 2017-07-24 13:55:32 +02:00
Thomas Waldmann e431d60cc5 merge 1.0-maint into master
# Conflicts:
#	src/borg/crypto.pyx
#	src/borg/hashindex.pyx
#	src/borg/helpers.py
#	src/borg/platform/__init__.py
#	src/borg/platform/darwin.pyx
#	src/borg/platform/freebsd.pyx
#	src/borg/platform/linux.pyx
#	src/borg/remote.py
2017-01-14 03:07:11 +01:00
Thomas Waldmann afab1cc9b0 Merge branch '1.0-maint'
# Conflicts:
#	borg/platform.py
#	src/borg/archiver.py
#	src/borg/helpers.py
#	src/borg/platform/darwin.pyx
#	src/borg/platform/freebsd.pyx
#	src/borg/platform/linux.pyx
#	src/borg/testsuite/__init__.py
2016-11-17 23:56:34 +01:00
Marian Beermann 2bd8ac7762 platform: bump API version (and check consistency) 2016-11-07 21:54:16 +01:00
Thomas Waldmann 60da32123a refactor to use Item class, fixes #1071 2016-06-04 17:24:55 +02:00
Marian Beermann 0ca1a18b33
Make borg.platform a package 2016-05-31 15:38:56 +02:00
Renamed from src/borg/platform_freebsd.pyx (Browse further)