diff --git a/src/middlewared/middlewared/plugins/smb_/groupmap.py b/src/middlewared/middlewared/plugins/smb_/groupmap.py index c867144cdbf4c..dbf091294b57b 100644 --- a/src/middlewared/middlewared/plugins/smb_/groupmap.py +++ b/src/middlewared/middlewared/plugins/smb_/groupmap.py @@ -4,18 +4,24 @@ from middlewared.service import Service, job, private from middlewared.service_exception import CallError -from middlewared.utils import run from middlewared.utils.directoryservices.constants import IDType from middlewared.utils.sid import ( + BASE_RID_USER, db_id_to_rid, get_domain_rid, lsa_sidtype, DomainRid ) +from middlewared.utils.tdb import ( + get_tdb_handle, + TDBDataType, + TDBPathType, + TDBOptions, +) from middlewared.plugins.smb_.constants import SMBBuiltin, SMBPath from middlewared.plugins.smb_.util_groupmap import ( delete_groupmap_entry, - insert_groupmap_entry, + insert_groupmap_entries, query_groupmap_entries, GroupmapFile, GroupmapEntryType, @@ -31,7 +37,7 @@ def clear_winbind_idmap_cache(): - with get_tdb_handle(WINBIND_IDMAP_FILE, WINBIND_IDMAP_TDB_OPTIONS) as hdl: + with get_tdb_handle(WINBIND_IDMAP_CACHE, WINBIND_IDMAP_TDB_OPTIONS) as hdl: return hdl.clear() @@ -304,7 +310,7 @@ def sync_builtins(self, to_add): sid_type=lsa_sidtype.ALIAS, name=b.nt_name, comment='' - ) + )) return self.validate_groupmap_hwm(low_range) @@ -316,7 +322,7 @@ def synchronize_group_mappings(self, job, bypass_sentinel_check=False): 1) ensures that group_mapping.tdb has all required groupmap entries 2) ensures that builtin SIDs S-1-5-32-544, S-1-5-32-545, and S-1-5-32-546 exist and are deterministically mapped to expected GIDs - 3) ensures that all expected foreign aliases for builtin SIDs above exist. + 3) ensures that all expected foreign aliases for builtin SIDs above exist. 4) flush various caches if required. """ entries = []