diff --git a/src/borg/archive.py b/src/borg/archive.py index 1baa8fd6f..fd47a977d 100644 --- a/src/borg/archive.py +++ b/src/borg/archive.py @@ -397,7 +397,7 @@ class Archive: """Failed to encode filename "{}" into file system encoding "{}". Consider configuring the LANG environment variable.""" def __init__(self, repository, key, manifest, name, cache=None, create=False, - checkpoint_interval=1800, numeric_owner=False, noatime=False, noctime=False, + checkpoint_interval=1800, numeric_ids=False, noatime=False, noctime=False, noflags=False, noacls=False, noxattrs=False, progress=False, chunker_params=CHUNKER_PARAMS, start=None, start_monotonic=None, end=None, consider_part_files=False, log_json=False): @@ -413,7 +413,7 @@ class Archive: self.name_in_manifest = name # can differ from .name later (if borg check fixed duplicate archive names) self.comment = None self.checkpoint_interval = checkpoint_interval - self.numeric_owner = numeric_owner + self.numeric_ids = numeric_ids self.noatime = noatime self.noctime = noctime self.noflags = noflags @@ -827,7 +827,7 @@ Utilization of max. archive size: {csize_max:.0%} Does not access the repository. """ backup_io.op = 'attrs' - uid, gid = get_item_uid_gid(item, numeric=self.numeric_owner) + uid, gid = get_item_uid_gid(item, numeric=self.numeric_ids) # This code is a bit of a mess due to os specific differences if not is_win32: try: @@ -870,7 +870,7 @@ Utilization of max. archive size: {csize_max:.0%} # some systems don't support calling utime on a symlink pass if not self.noacls: - acl_set(path, item, self.numeric_owner, fd=fd) + acl_set(path, item, self.numeric_ids, fd=fd) if not self.noxattrs: # chown removes Linux capabilities, so set the extended attributes at the end, after chown, since they include # the Linux capabilities in the "security.capability" attribute. @@ -1057,10 +1057,10 @@ Utilization of max. archive size: {csize_max:.0%} class MetadataCollector: - def __init__(self, *, noatime, noctime, nobirthtime, numeric_owner, noflags, noacls, noxattrs): + def __init__(self, *, noatime, noctime, nobirthtime, numeric_ids, noflags, noacls, noxattrs): self.noatime = noatime self.noctime = noctime - self.numeric_owner = numeric_owner + self.numeric_ids = numeric_ids self.noflags = noflags self.noacls = noacls self.noxattrs = noxattrs @@ -1083,7 +1083,7 @@ class MetadataCollector: if not self.nobirthtime and hasattr(st, 'st_birthtime'): # sadly, there's no stat_result.st_birthtime_ns attrs['birthtime'] = safe_ns(int(st.st_birthtime * 10**9)) - if self.numeric_owner: + if self.numeric_ids: attrs['user'] = attrs['group'] = None else: attrs['user'] = uid2user(st.st_uid) @@ -1096,7 +1096,7 @@ class MetadataCollector: flags = 0 if self.noflags else get_flags(path, st, fd=fd) xattrs = {} if self.noxattrs else xattr.get_all(fd or path, follow_symlinks=False) if not self.noacls: - acl_get(path, attrs, st, self.numeric_owner, fd=fd) + acl_get(path, attrs, st, self.numeric_ids, fd=fd) if xattrs: attrs['xattrs'] = StableDict(xattrs) if flags: diff --git a/src/borg/archiver.py b/src/borg/archiver.py index 45d62d31b..51f9bc7ff 100644 --- a/src/borg/archiver.py +++ b/src/borg/archiver.py @@ -187,7 +187,7 @@ def with_archive(method): @functools.wraps(method) def wrapper(self, args, repository, key, manifest, **kwargs): archive = Archive(repository, key, manifest, args.location.archive, - numeric_owner=getattr(args, 'numeric_owner', False), + numeric_ids=getattr(args, 'numeric_ids', False), noflags=getattr(args, 'nobsdflags', False) or getattr(args, 'noflags', False), noacls=getattr(args, 'noacls', False), noxattrs=getattr(args, 'noxattrs', False), @@ -650,13 +650,13 @@ class Archiver: cache_mode=args.files_cache_mode) as cache: archive = Archive(repository, key, manifest, args.location.archive, cache=cache, create=True, checkpoint_interval=args.checkpoint_interval, - numeric_owner=args.numeric_owner, noatime=not args.atime, noctime=args.noctime, + numeric_ids=args.numeric_ids, noatime=not args.atime, noctime=args.noctime, progress=args.progress, chunker_params=args.chunker_params, start=t0, start_monotonic=t0_monotonic, log_json=args.log_json) metadata_collector = MetadataCollector(noatime=not args.atime, noctime=args.noctime, noflags=args.nobsdflags or args.noflags, noacls=args.noacls, noxattrs=args.noxattrs, - numeric_owner=args.numeric_owner, nobirthtime=args.nobirthtime) + numeric_ids=args.numeric_ids, nobirthtime=args.nobirthtime) cp = ChunksProcessor(cache=cache, key=key, add_item=archive.add_item, write_checkpoint=archive.write_checkpoint, checkpoint_interval=args.checkpoint_interval, rechunkify=False) @@ -2546,7 +2546,8 @@ class Archiver: deprecations = [ # ('--old', '--new' or None, 'Warning: "--old" has been deprecated. Use "--new" instead.'), ('--noatime', None, 'Warning: "--noatime" has been deprecated because it is the default now.'), - ('--nobsdflags', None, 'Warning: "--nobsdflags" has been deprecated. Use --noflags instead.') + ('--nobsdflags', None, 'Warning: "--nobsdflags" has been deprecated. Use --noflags instead.'), + ('--numeric-owner', None, 'Warning: "--numeric-owner" has been deprecated. Use --numeric-ids instead.'), ] for i, arg in enumerate(args[:]): for old_name, new_name, warning in deprecations: @@ -2827,7 +2828,9 @@ class Archiver: help='stay in foreground, do not daemonize') parser.add_argument('-o', dest='options', type=str, help='Extra mount options') - parser.add_argument('--numeric-owner', dest='numeric_owner', action='store_true', + parser.add_argument('--numeric-owner', dest='numeric_ids', action='store_true', + help='deprecated, use ``--numeric-ids`` instead') + parser.add_argument('--numeric-ids', dest='numeric_ids', action='store_true', help='use numeric user and group identifiers from archive(s)') define_archive_filters_group(parser) parser.add_argument('paths', metavar='PATH', nargs='*', type=str, @@ -3378,7 +3381,9 @@ class Archiver: fs_group = subparser.add_argument_group('Filesystem options') fs_group.add_argument('-x', '--one-file-system', dest='one_file_system', action='store_true', help='stay in the same file system and do not store mount points of other file systems. This might behave different from your expectations, see the docs.') - fs_group.add_argument('--numeric-owner', dest='numeric_owner', action='store_true', + fs_group.add_argument('--numeric-owner', dest='numeric_ids', action='store_true', + help='deprecated, use ``--numeric-ids`` instead') + fs_group.add_argument('--numeric-ids', dest='numeric_ids', action='store_true', help='only store numeric user and group identifiers') # --noatime is the default now and the flag is deprecated. args.noatime is not used any more. # use --atime if you want to store the atime (default behaviour before borg 1.2.0a7).. @@ -3708,7 +3713,9 @@ class Archiver: formatter_class=argparse.RawDescriptionHelpFormatter, help='find differences in archive contents') subparser.set_defaults(func=self.do_diff) - subparser.add_argument('--numeric-owner', dest='numeric_owner', action='store_true', + subparser.add_argument('--numeric-owner', dest='numeric_ids', action='store_true', + help='deprecated, use ``--numeric-ids`` instead') + subparser.add_argument('--numeric-ids', dest='numeric_ids', action='store_true', help='only consider numeric user and group identifiers') subparser.add_argument('--same-chunker-params', dest='same_chunker_params', action='store_true', help='Override check of chunker parameters.') @@ -3812,7 +3819,9 @@ class Archiver: help='output verbose list of items (files, dirs, ...)') subparser.add_argument('-n', '--dry-run', dest='dry_run', action='store_true', help='do not actually change any files') - subparser.add_argument('--numeric-owner', dest='numeric_owner', action='store_true', + subparser.add_argument('--numeric-owner', dest='numeric_ids', action='store_true', + help='deprecated, use ``--numeric-ids`` instead') + subparser.add_argument('--numeric-ids', dest='numeric_ids', action='store_true', help='only obey numeric user and group identifiers') subparser.add_argument('--nobsdflags', dest='nobsdflags', action='store_true', help='deprecated, use ``--noflags`` instead') diff --git a/src/borg/fuse.py b/src/borg/fuse.py index 1c9840b4c..7cecdabe5 100644 --- a/src/borg/fuse.py +++ b/src/borg/fuse.py @@ -241,7 +241,7 @@ class FuseBackend(object): def __init__(self, key, manifest, repository, args, decrypted_repository): self.repository_uncached = repository self._args = args - self.numeric_owner = args.numeric_owner + self.numeric_ids = args.numeric_ids self._manifest = manifest self.key = key # Maps inode numbers to Item instances. This is used for synthetic inodes, i.e. file-system objects that are @@ -588,7 +588,7 @@ class FuseOperations(llfuse.Operations, FuseBackend): entry.attr_timeout = 300 entry.st_mode = item.mode & ~self.umask entry.st_nlink = item.get('nlink', 1) - entry.st_uid, entry.st_gid = get_item_uid_gid(item, numeric=self.numeric_owner, + entry.st_uid, entry.st_gid = get_item_uid_gid(item, numeric=self.numeric_ids, uid_default=self.default_uid, gid_default=self.default_gid, uid_forced=self.uid_forced, gid_forced=self.gid_forced) entry.st_rdev = item.get('rdev', 0) diff --git a/src/borg/item.pyx b/src/borg/item.pyx index e1012e7a8..24aec344c 100644 --- a/src/borg/item.pyx +++ b/src/borg/item.pyx @@ -412,10 +412,10 @@ class ItemDiff: It does not include extended or time attributes in the comparison. """ - def __init__(self, item1, item2, chunk_iterator1, chunk_iterator2, numeric_owner=False, can_compare_chunk_ids=False): + def __init__(self, item1, item2, chunk_iterator1, chunk_iterator2, numeric_ids=False, can_compare_chunk_ids=False): self._item1 = item1 self._item2 = item2 - self._numeric_owner = numeric_owner + self._numeric_ids = numeric_ids self._can_compare_chunk_ids = can_compare_chunk_ids self.equal = self._equal(chunk_iterator1, chunk_iterator2) changes = [] @@ -434,7 +434,7 @@ class ItemDiff: changes.append(self._mode_diff()) # filter out empty changes - self._changes = [ch for ch in changes if ch] + self._changes = [ch for ch in changes if ch] def changes(self): return self._changes @@ -450,7 +450,7 @@ class ItemDiff: return True attr_list = ['deleted', 'mode', 'source'] - attr_list += ['uid', 'gid'] if self._numeric_owner else ['user', 'group'] + attr_list += ['uid', 'gid'] if self._numeric_ids else ['user', 'group'] for attr in attr_list: if self._item1.get(attr) != self._item2.get(attr): return False @@ -491,7 +491,7 @@ class ItemDiff: return ({"type": "modified", "added": added, "removed": removed}, '{:>9} {:>9}'.format(format_file_size(added, precision=1, sign=True), format_file_size(-removed, precision=1, sign=True))) - + def _dir_diff(self): if self._item2.get('deleted') and not self._item1.get('deleted'): return ({"type": 'removed directory'}, 'removed directory') @@ -499,7 +499,7 @@ class ItemDiff: return ({"type": 'added directory'}, 'added directory') def _owner_diff(self): - u_attr, g_attr = ('uid', 'gid') if self._numeric_owner else ('user', 'group') + u_attr, g_attr = ('uid', 'gid') if self._numeric_ids else ('user', 'group') u1, g1 = self._item1.get(u_attr), self._item1.get(g_attr) u2, g2 = self._item2.get(u_attr), self._item2.get(g_attr) if (u1, g1) != (u2, g2): diff --git a/src/borg/platform/base.py b/src/borg/platform/base.py index 5e5e2eb56..ba94f91d0 100644 --- a/src/borg/platform/base.py +++ b/src/borg/platform/base.py @@ -62,19 +62,19 @@ def setxattr(path, name, value, *, follow_symlinks=False): """ -def acl_get(path, item, st, numeric_owner=False, fd=None): +def acl_get(path, item, st, numeric_ids=False, fd=None): """ Saves ACL Entries - If `numeric_owner` is True the user/group field is not preserved only uid/gid + If `numeric_ids` is True the user/group field is not preserved only uid/gid """ -def acl_set(path, item, numeric_owner=False, fd=None): +def acl_set(path, item, numeric_ids=False, fd=None): """ Restore ACL Entries - If `numeric_owner` is True the stored uid/gid is used instead + If `numeric_ids` is True the stored uid/gid is used instead of the user/group names """ diff --git a/src/borg/platform/darwin.pyx b/src/borg/platform/darwin.pyx index 635e03981..b3ecc8140 100644 --- a/src/borg/platform/darwin.pyx +++ b/src/borg/platform/darwin.pyx @@ -110,7 +110,7 @@ def _remove_non_numeric_identifier(acl): return safe_encode('\n'.join(entries)) -def acl_get(path, item, st, numeric_owner=False, fd=None): +def acl_get(path, item, st, numeric_ids=False, fd=None): cdef acl_t acl = NULL cdef char *text = NULL if isinstance(path, str): @@ -125,7 +125,7 @@ def acl_get(path, item, st, numeric_owner=False, fd=None): text = acl_to_text(acl, NULL) if text == NULL: return - if numeric_owner: + if numeric_ids: item['acl_extended'] = _remove_non_numeric_identifier(text) else: item['acl_extended'] = text @@ -134,12 +134,12 @@ def acl_get(path, item, st, numeric_owner=False, fd=None): acl_free(acl) -def acl_set(path, item, numeric_owner=False, fd=None): +def acl_set(path, item, numeric_ids=False, fd=None): cdef acl_t acl = NULL acl_text = item.get('acl_extended') if acl_text is not None: try: - if numeric_owner: + if numeric_ids: acl = acl_from_text(acl_text) else: acl = acl_from_text(_remove_numeric_id_if_possible(acl_text)) diff --git a/src/borg/platform/freebsd.pyx b/src/borg/platform/freebsd.pyx index 2c8a22030..9266726b4 100644 --- a/src/borg/platform/freebsd.pyx +++ b/src/borg/platform/freebsd.pyx @@ -120,10 +120,10 @@ cdef _get_acl(p, type, item, attribute, flags, fd=None): acl_free(acl) -def acl_get(path, item, st, numeric_owner=False, fd=None): +def acl_get(path, item, st, numeric_ids=False, fd=None): """Saves ACL Entries - If `numeric_owner` is True the user/group field is not preserved only uid/gid + If `numeric_ids` is True the user/group field is not preserved only uid/gid """ cdef int flags = ACL_TEXT_APPEND_ID if isinstance(path, str): @@ -131,7 +131,7 @@ def acl_get(path, item, st, numeric_owner=False, fd=None): ret = lpathconf(path, _PC_ACL_NFS4) if ret < 0 and errno == EINVAL: return - flags |= ACL_TEXT_NUMERIC_IDS if numeric_owner else 0 + flags |= ACL_TEXT_NUMERIC_IDS if numeric_ids else 0 if ret > 0: _get_acl(path, ACL_TYPE_NFS4, item, 'acl_nfs4', flags, fd=fd) else: @@ -139,13 +139,13 @@ def acl_get(path, item, st, numeric_owner=False, fd=None): _get_acl(path, ACL_TYPE_DEFAULT, item, 'acl_default', flags, fd=fd) -cdef _set_acl(p, type, item, attribute, numeric_owner=False, fd=None): +cdef _set_acl(p, type, item, attribute, numeric_ids=False, fd=None): cdef acl_t acl text = item.get(attribute) if text: - if numeric_owner and type == ACL_TYPE_NFS4: + if numeric_ids and type == ACL_TYPE_NFS4: text = _nfs4_use_stored_uid_gid(text) - elif numeric_owner and type in(ACL_TYPE_ACCESS, ACL_TYPE_DEFAULT): + elif numeric_ids and type in(ACL_TYPE_ACCESS, ACL_TYPE_DEFAULT): text = posix_acl_use_stored_uid_gid(text) acl = acl_from_text(text) if acl: @@ -170,14 +170,14 @@ cdef _nfs4_use_stored_uid_gid(acl): return safe_encode('\n'.join(entries)) -def acl_set(path, item, numeric_owner=False, fd=None): +def acl_set(path, item, numeric_ids=False, fd=None): """Restore ACL Entries - If `numeric_owner` is True the stored uid/gid is used instead + If `numeric_ids` is True the stored uid/gid is used instead of the user/group names """ if isinstance(path, str): path = os.fsencode(path) - _set_acl(path, ACL_TYPE_NFS4, item, 'acl_nfs4', numeric_owner, fd=fd) - _set_acl(path, ACL_TYPE_ACCESS, item, 'acl_access', numeric_owner, fd=fd) - _set_acl(path, ACL_TYPE_DEFAULT, item, 'acl_default', numeric_owner, fd=fd) + _set_acl(path, ACL_TYPE_NFS4, item, 'acl_nfs4', numeric_ids, fd=fd) + _set_acl(path, ACL_TYPE_ACCESS, item, 'acl_access', numeric_ids, fd=fd) + _set_acl(path, ACL_TYPE_DEFAULT, item, 'acl_default', numeric_ids, fd=fd) diff --git a/src/borg/platform/linux.pyx b/src/borg/platform/linux.pyx index b4991c51d..9b449434b 100644 --- a/src/borg/platform/linux.pyx +++ b/src/borg/platform/linux.pyx @@ -227,7 +227,7 @@ cdef acl_numeric_ids(acl): return safe_encode('\n'.join(entries)) -def acl_get(path, item, st, numeric_owner=False, fd=None): +def acl_get(path, item, st, numeric_ids=False, fd=None): cdef acl_t default_acl = NULL cdef acl_t access_acl = NULL cdef char *default_text = NULL @@ -242,7 +242,7 @@ def acl_get(path, item, st, numeric_owner=False, fd=None): or fd is None and acl_extended_file(path) <= 0): return - if numeric_owner: + if numeric_ids: converter = acl_numeric_ids else: converter = acl_append_numeric_ids @@ -269,7 +269,7 @@ def acl_get(path, item, st, numeric_owner=False, fd=None): acl_free(access_acl) -def acl_set(path, item, numeric_owner=False, fd=None): +def acl_set(path, item, numeric_ids=False, fd=None): cdef acl_t access_acl = NULL cdef acl_t default_acl = NULL @@ -279,7 +279,7 @@ def acl_set(path, item, numeric_owner=False, fd=None): if fd is None and isinstance(path, str): path = os.fsencode(path) - if numeric_owner: + if numeric_ids: converter = posix_acl_use_stored_uid_gid else: converter = acl_use_local_uid_gid diff --git a/src/borg/testsuite/platform.py b/src/borg/testsuite/platform.py index 473da3ef0..d0b510db8 100644 --- a/src/borg/testsuite/platform.py +++ b/src/borg/testsuite/platform.py @@ -81,25 +81,25 @@ class PlatformLinuxTestCase(BaseTestCase): def tearDown(self): shutil.rmtree(self.tmpdir) - def get_acl(self, path, numeric_owner=False): + def get_acl(self, path, numeric_ids=False): item = {} - acl_get(path, item, os.stat(path), numeric_owner=numeric_owner) + acl_get(path, item, os.stat(path), numeric_ids=numeric_ids) return item - def set_acl(self, path, access=None, default=None, numeric_owner=False): + def set_acl(self, path, access=None, default=None, numeric_ids=False): item = {'acl_access': access, 'acl_default': default} - acl_set(path, item, numeric_owner=numeric_owner) + acl_set(path, item, numeric_ids=numeric_ids) @unittest.skipIf(not are_acls_working(), 'ACLs do not work') def test_access_acl(self): file = tempfile.NamedTemporaryFile() self.assert_equal(self.get_acl(file.name), {}) - self.set_acl(file.name, access=b'user::rw-\ngroup::r--\nmask::rw-\nother::---\nuser:root:rw-:9999\ngroup:root:rw-:9999\n', numeric_owner=False) + self.set_acl(file.name, access=b'user::rw-\ngroup::r--\nmask::rw-\nother::---\nuser:root:rw-:9999\ngroup:root:rw-:9999\n', numeric_ids=False) self.assert_in(b'user:root:rw-:0', self.get_acl(file.name)['acl_access']) self.assert_in(b'group:root:rw-:0', self.get_acl(file.name)['acl_access']) - self.assert_in(b'user:0:rw-:0', self.get_acl(file.name, numeric_owner=True)['acl_access']) + self.assert_in(b'user:0:rw-:0', self.get_acl(file.name, numeric_ids=True)['acl_access']) file2 = tempfile.NamedTemporaryFile() - self.set_acl(file2.name, access=b'user::rw-\ngroup::r--\nmask::rw-\nother::---\nuser:root:rw-:9999\ngroup:root:rw-:9999\n', numeric_owner=True) + self.set_acl(file2.name, access=b'user::rw-\ngroup::r--\nmask::rw-\nother::---\nuser:root:rw-:9999\ngroup:root:rw-:9999\n', numeric_ids=True) self.assert_in(b'user:9999:rw-:9999', self.get_acl(file2.name)['acl_access']) self.assert_in(b'group:9999:rw-:9999', self.get_acl(file2.name)['acl_access']) @@ -125,19 +125,19 @@ class PlatformLinuxTestCase(BaseTestCase): group_entry = 'group:übel:rw-:666'.encode('utf-8') group_entry_numeric = 'group:666:rw-:666'.encode('ascii') acl = b'\n'.join([nothing_special, user_entry, group_entry]) - self.set_acl(file.name, access=acl, numeric_owner=False) - acl_access = self.get_acl(file.name, numeric_owner=False)['acl_access'] + self.set_acl(file.name, access=acl, numeric_ids=False) + acl_access = self.get_acl(file.name, numeric_ids=False)['acl_access'] self.assert_in(user_entry, acl_access) self.assert_in(group_entry, acl_access) - acl_access_numeric = self.get_acl(file.name, numeric_owner=True)['acl_access'] + acl_access_numeric = self.get_acl(file.name, numeric_ids=True)['acl_access'] self.assert_in(user_entry_numeric, acl_access_numeric) self.assert_in(group_entry_numeric, acl_access_numeric) file2 = tempfile.NamedTemporaryFile() - self.set_acl(file2.name, access=acl, numeric_owner=True) - acl_access = self.get_acl(file2.name, numeric_owner=False)['acl_access'] + self.set_acl(file2.name, access=acl, numeric_ids=True) + acl_access = self.get_acl(file2.name, numeric_ids=False)['acl_access'] self.assert_in(user_entry, acl_access) self.assert_in(group_entry, acl_access) - acl_access_numeric = self.get_acl(file.name, numeric_owner=True)['acl_access'] + acl_access_numeric = self.get_acl(file.name, numeric_ids=True)['acl_access'] self.assert_in(user_entry_numeric, acl_access_numeric) self.assert_in(group_entry_numeric, acl_access_numeric) @@ -159,26 +159,26 @@ class PlatformDarwinTestCase(BaseTestCase): def tearDown(self): shutil.rmtree(self.tmpdir) - def get_acl(self, path, numeric_owner=False): + def get_acl(self, path, numeric_ids=False): item = {} - acl_get(path, item, os.stat(path), numeric_owner=numeric_owner) + acl_get(path, item, os.stat(path), numeric_ids=numeric_ids) return item - def set_acl(self, path, acl, numeric_owner=False): + def set_acl(self, path, acl, numeric_ids=False): item = {'acl_extended': acl} - acl_set(path, item, numeric_owner=numeric_owner) + acl_set(path, item, numeric_ids=numeric_ids) @unittest.skipIf(not are_acls_working(), 'ACLs do not work') def test_access_acl(self): file = tempfile.NamedTemporaryFile() file2 = tempfile.NamedTemporaryFile() self.assert_equal(self.get_acl(file.name), {}) - self.set_acl(file.name, b'!#acl 1\ngroup:ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000000:staff:0:allow:read\nuser:FFFFEEEE-DDDD-CCCC-BBBB-AAAA00000000:root:0:allow:read\n', numeric_owner=False) + self.set_acl(file.name, b'!#acl 1\ngroup:ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000000:staff:0:allow:read\nuser:FFFFEEEE-DDDD-CCCC-BBBB-AAAA00000000:root:0:allow:read\n', numeric_ids=False) self.assert_in(b'group:ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000014:staff:20:allow:read', self.get_acl(file.name)['acl_extended']) self.assert_in(b'user:FFFFEEEE-DDDD-CCCC-BBBB-AAAA00000000:root:0:allow:read', self.get_acl(file.name)['acl_extended']) - self.set_acl(file2.name, b'!#acl 1\ngroup:ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000000:staff:0:allow:read\nuser:FFFFEEEE-DDDD-CCCC-BBBB-AAAA00000000:root:0:allow:read\n', numeric_owner=True) + self.set_acl(file2.name, b'!#acl 1\ngroup:ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000000:staff:0:allow:read\nuser:FFFFEEEE-DDDD-CCCC-BBBB-AAAA00000000:root:0:allow:read\n', numeric_ids=True) self.assert_in(b'group:ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000000:wheel:0:allow:read', self.get_acl(file2.name)['acl_extended']) - self.assert_in(b'group:ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000000::0:allow:read', self.get_acl(file2.name, numeric_owner=True)['acl_extended']) + self.assert_in(b'group:ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000000::0:allow:read', self.get_acl(file2.name, numeric_ids=True)['acl_extended']) @unittest.skipUnless(sys.platform.startswith(('linux', 'freebsd', 'darwin')), 'POSIX only tests')