const char *map_attr_map_local(void *mem_ctx, const struct ldb_map_attribute *map, const char *attr)
{
	if (map == NULL) {
		return talloc_strdup(mem_ctx, attr);
	}

	switch (map->type) {
	case LDB_MAP_KEEP:
		return talloc_strdup(mem_ctx, attr);

	case LDB_MAP_RENAME:
	case LDB_MAP_RENDROP:
	case LDB_MAP_CONVERT:
		return talloc_strdup(mem_ctx, map->u.rename.remote_name);

	default:
		return NULL;
	}
}
const char *map_attr_map_local(void *mem_ctx, const struct ldb_map_attribute *map, const char *attr)
{
	if (map == NULL) {
		return talloc_strdup(mem_ctx, attr);
	}

	switch (map->type) {
	case LDB_MAP_KEEP:
		return talloc_strdup(mem_ctx, attr);

	case LDB_MAP_RENAME:
	case LDB_MAP_RENDROP:
	case LDB_MAP_CONVERT:
		return talloc_strdup(mem_ctx, map->u.rename.remote_name);

	default:
		return NULL;
	}
}