Lines Matching defs:map

53     struct sdap_attr_map *map;
56 map = talloc_array(memctx, struct sdap_attr_map, num_entries + 1);
57 if (!map) {
62 map[i].opt_name = talloc_strdup(map, src_map[i].opt_name);
63 map[i].sys_name = talloc_strdup(map, src_map[i].sys_name);
64 if (map[i].opt_name == NULL || map[i].sys_name == NULL) {
69 map[i].def_name = talloc_strdup(map, src_map[i].def_name);
70 map[i].name = talloc_strdup(map, src_map[i].def_name);
71 if (map[i].def_name == NULL || map[i].name == NULL) {
75 map[i].def_name = NULL;
76 map[i].name = NULL;
80 map[i].opt_name, map[i].name ? "" : " no",
81 map[i].name ? map[i].name : "");
85 memset(&map[num_entries], 0, sizeof(struct sdap_attr_map));
87 *_map = map;
131 static enum duplicate_t check_duplicate(struct sdap_attr_map *map,
139 if (strcmp(map[i].sys_name, sysdb_attr) == 0) {
140 if (strcmp(map[i].name, ldap_attr) == 0) {
158 struct sdap_attr_map *map;
175 map = talloc_realloc(memctx, src_map, struct sdap_attr_map,
177 if (map == NULL) {
182 ret = split_extra_attr(map, *extra_attrs, &sysdb_attr, &ldap_attr);
188 ret = check_duplicate(map, num_entries, sysdb_attr, ldap_attr);
191 "Attribute %s (%s in LDAP) is already in map.\n",
201 map[num_entries+i].name = ldap_attr;
202 map[num_entries+i].sys_name = sysdb_attr;
203 map[num_entries+i].opt_name = talloc_strdup(map,
204 map[num_entries+i].name);
205 map[num_entries+i].def_name = talloc_strdup(map,
206 map[num_entries+i].name);
207 if (map[num_entries+i].opt_name == NULL ||
208 map[num_entries+i].sys_name == NULL ||
209 map[num_entries+i].name == NULL ||
210 map[num_entries+i].def_name == NULL) {
213 DEBUG(SSSDBG_TRACE_FUNC, "Extending map with %s\n", *extra_attrs);
222 memset(&map[num_entries+nextra], 0, sizeof(struct sdap_attr_map));
224 *_map = map;
334 struct sdap_attr_map *map;
338 map = talloc_zero_array(memctx, struct sdap_attr_map, num_entries + 1);
339 if (!map) {
345 map[i].opt_name = def_map[i].opt_name;
346 map[i].def_name = def_map[i].def_name;
347 map[i].sys_name = def_map[i].sys_name;
349 ret = confdb_get_string(cdb, map, conf_path,
350 map[i].opt_name,
351 map[i].def_name,
355 "Failed to retrieve value for %s\n", map[i].opt_name);
356 talloc_zfree(map);
361 ret = sss_filter_sanitize(map, name, &map[i].name);
365 talloc_zfree(map);
370 map[i].name = NULL;
373 if (map[i].def_name && !map[i].name) {
375 "Failed to retrieve value for %s\n", map[i].opt_name);
376 talloc_zfree(map);
381 map[i].opt_name, map[i].name ? "" : " no",
382 map[i].name ? map[i].name : "");
385 *_map = map;
391 static bool objectclass_matched(struct sdap_attr_map *map,
395 struct sdap_attr_map *map, int attrs_num,
442 if (map) {
452 if (objectclass_matched(map, vals[i]->bv_val, vals[i]->bv_len)) {
459 map[0].name);
475 if (map) {
504 if (map) {
507 if (!map[i].name) continue;
509 if (strcasecmp(base_attr, map[i].name) == 0) break;
514 name = map[i].sys_name;
576 if (map) {
578 * attrs in case there is a map. Find all that match
584 if (!map[ai].name) continue;
587 if (strcasecmp(base_attr, map[ai].name) == 0) {
589 map[ai].sys_name,
598 /* No map, just store the attribute */
633 static bool objectclass_matched(struct sdap_attr_map *map,
640 if (strncasecmp(map[SDAP_OC_GROUP].name, objcl, len) == 0) {
644 if (map[SDAP_OC_GROUP_ALT].name != NULL
645 && strncasecmp(map[SDAP_OC_GROUP_ALT].name, objcl, len) == 0) {
663 struct sdap_attr_map *map;
688 res[i]->map = minfo[i].map;
748 map = NULL;
751 /* the objectclass is always the first name in the map */
752 if (objectclass_matched(minfo[mi].map, ocs[i], 0)) {
754 "Found map for objectclass '%s'\n", ocs[i]);
755 map = minfo[mi].map;
760 if (!map) continue;
780 if (!map[a].name) continue;
782 if (strcasecmp(dval->type, map[a].name) == 0) break;
787 name = map[a].sys_name;
1472 struct sdap_attr_map *map,
1484 /* Assume that all entries in the map have values */
1497 if (map[i].name && !attr_is_filtered(map[i].name, filter)) {
1498 attrs[j] = map[i].name;
1663 char *sdap_make_oc_list(TALLOC_CTX *mem_ctx, struct sdap_attr_map *map)
1665 if (map[SDAP_OC_GROUP_ALT].name == NULL) {
1667 map[SDAP_OC_GROUP].name);
1671 map[SDAP_OC_GROUP].name,
1672 map[SDAP_OC_GROUP_ALT].name);