diff options
| author | David M. Syzdek <david@syzdek.net> | 2019-11-26 23:15:59 -0900 |
|---|---|---|
| committer | David M. Syzdek <david@syzdek.net> | 2019-11-26 23:15:59 -0900 |
| commit | 5f337b9888457315c89216018ead6b66a638aff7 (patch) | |
| tree | 3f9d805f5466b81d71ed593766d9def6e06c3743 | |
| parent | dc857534293415a655f866969cd5d6b8a2e001b7 (diff) | |
| download | ldap-utils-5f337b9888457315c89216018ead6b66a638aff7.tar.gz ldap-utils-5f337b9888457315c89216018ead6b66a638aff7.tar.bz2 ldap-utils-5f337b9888457315c89216018ead6b66a638aff7.tar.xz ldap-utils-5f337b9888457315c89216018ead6b66a638aff7.zip | |
libldapschema: adding refernces from LDAPSchemaMatchingRule to LDAPSchemaLDAPAttributeType
| -rw-r--r-- | lib/libldapschema/lldap.c | 9 | ||||
| -rw-r--r-- | lib/libldapschema/llexer.c | 9 | ||||
| -rw-r--r-- | lib/libldapschema/loutput.c | 3 |
3 files changed, 17 insertions, 4 deletions
diff --git a/lib/libldapschema/lldap.c b/lib/libldapschema/lldap.c index fc8e14e..e546795 100644 --- a/lib/libldapschema/lldap.c +++ b/lib/libldapschema/lldap.c | |||
| @@ -215,11 +215,14 @@ int ldapschema_fetch(LDAPSchema * lsd, LDAP * ld) | |||
| 215 | if (!(attr->usage)) | 215 | if (!(attr->usage)) |
| 216 | attr->usage = attrsup->usage; | 216 | attr->usage = attrsup->usage; |
| 217 | if (!(attr->equality)) | 217 | if (!(attr->equality)) |
| 218 | attr->equality = attrsup->equality; | 218 | if ((attr->equality = attrsup->equality) != NULL) |
| 219 | ldapschema_insert(lsd, (void ***)&attr->equality->used_by, &attr->equality->used_by_len, attr, ldapschema_compar_models); | ||
| 219 | if (!(attr->ordering)) | 220 | if (!(attr->ordering)) |
| 220 | attr->ordering = attrsup->ordering; | 221 | if ((attr->ordering = attrsup->ordering) != NULL) |
| 222 | ldapschema_insert(lsd, (void ***)&attr->ordering->used_by, &attr->ordering->used_by_len, attr, ldapschema_compar_models); | ||
| 221 | if (!(attr->substr)) | 223 | if (!(attr->substr)) |
| 222 | attr->substr = attrsup->substr; | 224 | if ((attr->substr = attrsup->substr) != NULL) |
| 225 | ldapschema_insert(lsd, (void ***)&attr->substr->used_by, &attr->substr->used_by_len, attr, ldapschema_compar_models); | ||
| 223 | }; | 226 | }; |
| 224 | }; | 227 | }; |
| 225 | }; | 228 | }; |
diff --git a/lib/libldapschema/llexer.c b/lib/libldapschema/llexer.c index ce94e2a..b0c2670 100644 --- a/lib/libldapschema/llexer.c +++ b/lib/libldapschema/llexer.c | |||
| @@ -589,7 +589,10 @@ LDAPSchemaAttributeType * ldapschema_parse_attributetype(LDAPSchema * lsd, const | |||
| 589 | { | 589 | { |
| 590 | pos++; | 590 | pos++; |
| 591 | if ((alias = ldapschema_find_alias(lsd, argv[pos], lsd->mtchngrls, lsd->mtchngrls_len)) != NULL) | 591 | if ((alias = ldapschema_find_alias(lsd, argv[pos], lsd->mtchngrls, lsd->mtchngrls_len)) != NULL) |
| 592 | { | ||
| 592 | attr->equality = alias->matchingrule; | 593 | attr->equality = alias->matchingrule; |
| 594 | ldapschema_insert(lsd, (void ***)&attr->equality->used_by, &attr->equality->used_by_len, attr, ldapschema_compar_models); | ||
| 595 | }; | ||
| 593 | } | 596 | } |
| 594 | 597 | ||
| 595 | // inteprets attributeType ORDERING | 598 | // inteprets attributeType ORDERING |
| @@ -597,7 +600,10 @@ LDAPSchemaAttributeType * ldapschema_parse_attributetype(LDAPSchema * lsd, const | |||
| 597 | { | 600 | { |
| 598 | pos++; | 601 | pos++; |
| 599 | if ((alias = ldapschema_find_alias(lsd, argv[pos], lsd->mtchngrls, lsd->mtchngrls_len)) != NULL) | 602 | if ((alias = ldapschema_find_alias(lsd, argv[pos], lsd->mtchngrls, lsd->mtchngrls_len)) != NULL) |
| 603 | { | ||
| 600 | attr->ordering = alias->matchingrule; | 604 | attr->ordering = alias->matchingrule; |
| 605 | ldapschema_insert(lsd, (void ***)&attr->ordering->used_by, &attr->ordering->used_by_len, attr, ldapschema_compar_models); | ||
| 606 | }; | ||
| 601 | } | 607 | } |
| 602 | 608 | ||
| 603 | // inteprets attributeType SUBSTR | 609 | // inteprets attributeType SUBSTR |
| @@ -605,7 +611,10 @@ LDAPSchemaAttributeType * ldapschema_parse_attributetype(LDAPSchema * lsd, const | |||
| 605 | { | 611 | { |
| 606 | pos++; | 612 | pos++; |
| 607 | if ((alias = ldapschema_find_alias(lsd, argv[pos], lsd->mtchngrls, lsd->mtchngrls_len)) != NULL) | 613 | if ((alias = ldapschema_find_alias(lsd, argv[pos], lsd->mtchngrls, lsd->mtchngrls_len)) != NULL) |
| 614 | { | ||
| 608 | attr->substr = alias->matchingrule; | 615 | attr->substr = alias->matchingrule; |
| 616 | ldapschema_insert(lsd, (void ***)&attr->substr->used_by, &attr->substr->used_by_len, attr, ldapschema_compar_models); | ||
| 617 | }; | ||
| 609 | } | 618 | } |
| 610 | 619 | ||
| 611 | // inteprets attributeType SYNTAX | 620 | // inteprets attributeType SYNTAX |
diff --git a/lib/libldapschema/loutput.c b/lib/libldapschema/loutput.c index 4b386b3..0d7afac 100644 --- a/lib/libldapschema/loutput.c +++ b/lib/libldapschema/loutput.c | |||
| @@ -553,6 +553,7 @@ void ldapschema_print_obj_matchingrule(LDAPSchema * lsd, LDAPSchemaMatchingRule | |||
| 553 | ldapschema_print_line("syntax:", buff); | 553 | ldapschema_print_line("syntax:", buff); |
| 554 | }; | 554 | }; |
| 555 | 555 | ||
| 556 | ldapschema_print_list_models(lsd, "used by:", (LDAPSchemaModel **)mtchngrl->used_by, mtchngrl->used_by_len); | ||
| 556 | ldapschema_print_extensions(lsd, &mtchngrl->model); | 557 | ldapschema_print_extensions(lsd, &mtchngrl->model); |
| 557 | ldapschema_print_definition(lsd, &mtchngrl->model); | 558 | ldapschema_print_definition(lsd, &mtchngrl->model); |
| 558 | ldapschema_print_issues(lsd, &mtchngrl->model); | 559 | ldapschema_print_issues(lsd, &mtchngrl->model); |
| @@ -628,8 +629,8 @@ void ldapschema_print_obj_syntax(LDAPSchema * lsd, LDAPSchemaSyntax * syntax) | |||
| 628 | ldapschema_print_data_class(lsd, syntax->data_class); | 629 | ldapschema_print_data_class(lsd, syntax->data_class); |
| 629 | ldapschema_print_flags(lsd, &syntax->model); | 630 | ldapschema_print_flags(lsd, &syntax->model); |
| 630 | ldapschema_print_extensions(lsd, &syntax->model); | 631 | ldapschema_print_extensions(lsd, &syntax->model); |
| 631 | ldapschema_print_list_models(lsd, "attributeTypes:", (LDAPSchemaModel **)syntax->attrs, syntax->attrs_len); | ||
| 632 | ldapschema_print_list_models(lsd, "matchingRules:", (LDAPSchemaModel **)syntax->mtchngrls, syntax->mtchngrls_len); | 632 | ldapschema_print_list_models(lsd, "matchingRules:", (LDAPSchemaModel **)syntax->mtchngrls, syntax->mtchngrls_len); |
| 633 | ldapschema_print_list_models(lsd, "used by:", (LDAPSchemaModel **)syntax->attrs, syntax->attrs_len); | ||
| 633 | ldapschema_print_spec(lsd, syntax->model.spec); | 634 | ldapschema_print_spec(lsd, syntax->model.spec); |
| 634 | ldapschema_print_definition(lsd, &syntax->model); | 635 | ldapschema_print_definition(lsd, &syntax->model); |
| 635 | ldapschema_print_issues(lsd, &syntax->model); | 636 | ldapschema_print_issues(lsd, &syntax->model); |
