-/* === Enumeration functions for uid mapping === */
-
-/* Context -- one and only one. Should be cycled through once on uid
- * mapping and once on gid mapping. */
-static item_list *_enum_racl_lists[] = {
- &access_acl_list, &default_acl_list, NULL
-};
-
-static item_list **enum_racl_list = &_enum_racl_lists[0];
-static int enum_ida_index = 0;
-static size_t enum_racl_index = 0;
-
-/* This returns the next tag_type id from the given ACL for the next entry,
- * or it returns 0 if there are no more tag_type ids in the acl. */
-static id_t *next_ace_id(SMB_ACL_TAG_T tag_type, const rsync_acl *racl)
-{
- const ida_entries *idal = tag_type == SMB_ACL_USER ? &racl->users : &racl->groups;
- if (enum_ida_index < idal->count) {
- id_access *ida = &idal->idas[enum_ida_index++];
- return &ida->id;
- }
- enum_ida_index = 0;
- return NULL;
-}
-
-static id_t *next_acl_id(SMB_ACL_TAG_T tag_type, const item_list *racl_list)
-{
- for (; enum_racl_index < racl_list->count; enum_racl_index++) {
- id_t *id;
- acl_duo *duo_item = racl_list->items;
- duo_item += enum_racl_index;
- if ((id = next_ace_id(tag_type, &duo_item->racl)) != NULL)
- return id;
- }
- enum_racl_index = 0;
- return NULL;
-}
-
-static id_t *next_acl_list_id(SMB_ACL_TAG_T tag_type)
+/* Non-incremental recursion needs to convert all the received IDs.
+ * This is done in a single pass after receiving the whole file-list. */
+static void match_racl_ids(const item_list *racl_list)