mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
move call to frontend API
This commit is contained in:
parent
450b579971
commit
00f1c085cf
@ -45,12 +45,6 @@ meta_send_entry(
|
||||
LDAPMessage *e
|
||||
);
|
||||
|
||||
static int
|
||||
is_one_level_rdn(
|
||||
const char *rdn,
|
||||
int from
|
||||
);
|
||||
|
||||
int
|
||||
meta_back_search( Operation *op, SlapReply *rs )
|
||||
{
|
||||
@ -163,9 +157,12 @@ meta_back_search( Operation *op, SlapReply *rs )
|
||||
break;
|
||||
|
||||
case LDAP_SCOPE_ONELEVEL:
|
||||
if ( is_one_level_rdn( li->targets[ i ]->suffix.bv_val,
|
||||
suffixlen - op->o_req_ndn.bv_len - 1 )
|
||||
&& dnIsSuffix( &li->targets[ i ]->suffix, &op->o_req_ndn ) ) {
|
||||
{
|
||||
struct berval rdn = li->targets[ i ]->suffix;
|
||||
rdn.bv_len -= op->o_req_ndn.bv_len + STRLENOF( "," );
|
||||
if ( dnIsOneLevelRDN( &rdn )
|
||||
&& dnIsSuffix( &li->targets[ i ]->suffix, &op->o_req_ndn ) )
|
||||
{
|
||||
/*
|
||||
* if there is exactly one level,
|
||||
* make the target suffix the new
|
||||
@ -176,6 +173,7 @@ meta_back_search( Operation *op, SlapReply *rs )
|
||||
is_scope++;
|
||||
break;
|
||||
} /* else continue with the next case */
|
||||
}
|
||||
|
||||
case LDAP_SCOPE_BASE:
|
||||
/*
|
||||
@ -739,18 +737,4 @@ meta_send_entry(
|
||||
return LDAP_SUCCESS;
|
||||
}
|
||||
|
||||
static int
|
||||
is_one_level_rdn(
|
||||
const char *rdn,
|
||||
int from
|
||||
)
|
||||
{
|
||||
for ( ; from--; ) {
|
||||
if ( DN_SEPARATOR( rdn[ from ] ) ) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -1259,6 +1259,19 @@ dnIsSuffix(
|
||||
return( strcmp( dn->bv_val + d, suffix->bv_val ) == 0 );
|
||||
}
|
||||
|
||||
int
|
||||
dnIsOneLevelRDN( struct berval *rdn )
|
||||
{
|
||||
ber_len_t len = rdn->bv_len;
|
||||
for ( ; len--; ) {
|
||||
if ( DN_SEPARATOR( rdn->bv_val[ len ] ) ) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef HAVE_TLS
|
||||
/*
|
||||
* Convert an X.509 DN into a normalized LDAP DN
|
||||
|
@ -488,6 +488,8 @@ LDAP_SLAPD_F (int) rdnMatch LDAP_P((
|
||||
LDAP_SLAPD_F (int) dnIsSuffix LDAP_P((
|
||||
const struct berval *dn, const struct berval *suffix ));
|
||||
|
||||
LDAP_SLAPD_F (int) dnIsOneLevelRDN LDAP_P(( struct berval *rdn ));
|
||||
|
||||
LDAP_SLAPD_F (int) dnExtractRdn LDAP_P((
|
||||
struct berval *dn, struct berval *rdn, void *ctx ));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user