mirror of
https://github.com/borgbackup/borg.git
synced 2025-01-19 14:02:55 +00:00
linux: move ACL definitions to platform_linux test module
they are only used from there.
This commit is contained in:
parent
7f8eba4fbf
commit
9c1088c95c
2 changed files with 28 additions and 34 deletions
|
@ -9,32 +9,6 @@
|
|||
from . import unopened_tempfile
|
||||
from .locking import free_pid # NOQA
|
||||
|
||||
ACCESS_ACL = """
|
||||
user::rw-
|
||||
user:root:rw-:0
|
||||
user:9999:r--:9999
|
||||
group::r--
|
||||
group:root:r--:0
|
||||
group:9999:r--:9999
|
||||
mask::rw-
|
||||
other::r--
|
||||
""".strip().encode(
|
||||
"ascii"
|
||||
)
|
||||
|
||||
DEFAULT_ACL = """
|
||||
user::rw-
|
||||
user:root:r--:0
|
||||
user:8888:r--:8888
|
||||
group::r--
|
||||
group:root:r--:0
|
||||
group:8888:r--:8888
|
||||
mask::rw-
|
||||
other::r--
|
||||
""".strip().encode(
|
||||
"ascii"
|
||||
)
|
||||
|
||||
|
||||
def fakeroot_detected():
|
||||
return "FAKEROOTKEY" in os.environ
|
||||
|
|
|
@ -2,19 +2,39 @@
|
|||
import tempfile
|
||||
|
||||
from ..platform import acl_get, acl_set
|
||||
from .platform import (
|
||||
DEFAULT_ACL,
|
||||
ACCESS_ACL,
|
||||
skipif_not_linux,
|
||||
skipif_fakeroot_detected,
|
||||
skipif_acls_not_working,
|
||||
skipif_no_ubel_user,
|
||||
)
|
||||
from .platform import skipif_not_linux, skipif_fakeroot_detected, skipif_acls_not_working, skipif_no_ubel_user
|
||||
|
||||
# set module-level skips
|
||||
pytestmark = [skipif_not_linux, skipif_fakeroot_detected]
|
||||
|
||||
|
||||
ACCESS_ACL = """\
|
||||
user::rw-
|
||||
user:root:rw-:0
|
||||
user:9999:r--:9999
|
||||
group::r--
|
||||
group:root:r--:0
|
||||
group:9999:r--:9999
|
||||
mask::rw-
|
||||
other::r--\
|
||||
""".encode(
|
||||
"ascii"
|
||||
)
|
||||
|
||||
DEFAULT_ACL = """\
|
||||
user::rw-
|
||||
user:root:r--:0
|
||||
user:8888:r--:8888
|
||||
group::r--
|
||||
group:root:r--:0
|
||||
group:8888:r--:8888
|
||||
mask::rw-
|
||||
other::r--\
|
||||
""".encode(
|
||||
"ascii"
|
||||
)
|
||||
|
||||
|
||||
def get_acl(path, numeric_ids=False):
|
||||
item = {}
|
||||
acl_get(path, item, os.stat(path), numeric_ids=numeric_ids)
|
||||
|
|
Loading…
Reference in a new issue