Added dn_issuffixbv() like dn_issuffix, but with bervals.

This commit is contained in:
Howard Chu 2001-12-09 03:02:29 +00:00
parent 984c29bc5f
commit ebadb3737f
2 changed files with 13 additions and 0 deletions

View File

@ -450,6 +450,18 @@ char **dn_subtree(
}
dn_issuffixbv(
const struct berval *dn,
const struct berval *suffix
)
{
if (suffix->bv_len > dn->bv_len)
return 0;
return( strcmp( dn->bv_val + dn->bv_len - suffix->bv_len,
suffix->bv_val ) == 0 );
}
/*
* dn_issuffix - tells whether suffix is a suffix of dn. Both dn
* and suffix must be normalized.

View File

@ -329,6 +329,7 @@ LDAP_SLAPD_F (char **) dn_subtree LDAP_P(( Backend *be, const char *dn ));
LDAP_SLAPD_F (char *) dn_rdn LDAP_P(( Backend *be, const char *dn ));
LDAP_SLAPD_F (int) dn_rdnlen LDAP_P(( Backend *be, const char *dn ));
LDAP_SLAPD_F (int) dn_issuffix LDAP_P(( const char *dn, const char *suffix ));
LDAP_SLAPD_F (int) dn_issuffixbv LDAP_P(( const struct berval *dn, const struct berval *suffix ));
LDAP_SLAPD_F (int) rdn_validate LDAP_P(( const char* str ));
LDAP_SLAPD_F (char *) rdn_attr_value LDAP_P(( const char * rdn ));
LDAP_SLAPD_F (char *) rdn_attr_type LDAP_P(( const char * rdn ));