mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
cleanup null mapping detection
This commit is contained in:
parent
4f64bd9402
commit
71e35141e1
@ -64,7 +64,7 @@ ldap_back_attribute(
|
||||
|
||||
}
|
||||
ldap_back_map(&li->at_map, &entry_at->ad_cname, &mapped, BACKLDAP_MAP);
|
||||
if (mapped.bv_val == NULL) {
|
||||
if (mapped.bv_val == NULL || mapped.bv_val[0] == '\0') {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -111,7 +111,7 @@ ldap_back_attribute(
|
||||
} else {
|
||||
ldap_back_map(&li->oc_map, &v[j], &mapped,
|
||||
BACKLDAP_REMAP);
|
||||
if (mapped.bv_val) {
|
||||
if (mapped.bv_val && mapped.bv_val[0] != '\0') {
|
||||
ber_dupbv( &v[j], &mapped );
|
||||
if (v[j].bv_val)
|
||||
j++;
|
||||
|
@ -156,11 +156,11 @@ ldap_back_group(
|
||||
|
||||
ldap_back_map(&li->oc_map, &group_oc_name, &group_oc_name,
|
||||
BACKLDAP_MAP);
|
||||
if (group_oc_name.bv_val == NULL)
|
||||
if (group_oc_name.bv_val == NULL || group_oc_name.bv_val[0] == '\0')
|
||||
goto cleanup;
|
||||
ldap_back_map(&li->at_map, &group_at_name, &group_at_name,
|
||||
BACKLDAP_MAP);
|
||||
if (group_at_name.bv_val == NULL)
|
||||
if (group_at_name.bv_val == NULL || group_at_name.bv_val[0] == '\0')
|
||||
goto cleanup;
|
||||
|
||||
filter = ch_malloc(sizeof("(&(objectclass=)(=))")
|
||||
|
@ -174,11 +174,12 @@ ldap_back_map_filter(
|
||||
tmp.bv_len = p - q;
|
||||
tmp.bv_val = q;
|
||||
ldap_back_map(at_map, &tmp, &m, remap);
|
||||
if (m.bv_val == NULL)
|
||||
if (m.bv_val == NULL || m.bv_val[0] == '\0') {
|
||||
ldap_back_map(oc_map, &tmp, &m, remap);
|
||||
if (m.bv_val == NULL) {
|
||||
if (m.bv_val == NULL || m.bv_val[0] == '\0') {
|
||||
m = tmp;
|
||||
}
|
||||
}
|
||||
extra += p - q;
|
||||
plen = m.bv_len;
|
||||
extra -= plen;
|
||||
@ -233,7 +234,7 @@ ldap_back_map_attrs(
|
||||
|
||||
for (i = j = 0; an[i].an_name.bv_val; i++) {
|
||||
ldap_back_map(at_map, &an[i].an_name, &mapped, remap);
|
||||
if (mapped.bv_val != NULL)
|
||||
if (mapped.bv_val != NULL && mapped.bv_val != '\0')
|
||||
na[j++] = mapped.bv_val;
|
||||
}
|
||||
if (j == 0 && i != 0)
|
||||
|
@ -120,7 +120,7 @@ ldap_back_modify(
|
||||
|
||||
ldap_back_map(&li->at_map, &ml->sml_desc->ad_cname, &mapped,
|
||||
BACKLDAP_MAP);
|
||||
if (mapped.bv_val == NULL) {
|
||||
if (mapped.bv_val == NULL || mapped.bv_val[0] == '\0') {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -155,7 +155,7 @@ meta_back_add(
|
||||
|
||||
ldap_back_map( &li->targets[ candidate ]->at_map,
|
||||
&a->a_desc->ad_cname, &mapped, BACKLDAP_MAP );
|
||||
if ( mapped.bv_val == NULL ) {
|
||||
if ( mapped.bv_val == NULL || mapped.bv_val[0] == '\0' ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -141,7 +141,7 @@ meta_back_attribute(
|
||||
|
||||
ldap_back_map( &li->targets[ candidate ]->at_map,
|
||||
&entry_at->ad_cname, &mapped, BACKLDAP_MAP );
|
||||
if ( mapped.bv_val == NULL )
|
||||
if ( mapped.bv_val == NULL || mapped.bv_val[0] == '\0' )
|
||||
return 1;
|
||||
|
||||
rc = ldap_initialize( &ld, li->targets[ candidate ]->uri );
|
||||
@ -182,7 +182,7 @@ meta_back_attribute(
|
||||
}
|
||||
} else {
|
||||
ldap_back_map( &li->targets[ candidate ]->oc_map, &v[ j ], &mapped, BACKLDAP_REMAP );
|
||||
if ( mapped.bv_val ) {
|
||||
if ( mapped.bv_val && mapped.bv_val[0] != '\0' ) {
|
||||
ber_dupbv( &v[ j ], &mapped );
|
||||
if ( v[ j ].bv_val ) {
|
||||
j++;
|
||||
|
@ -223,12 +223,12 @@ meta_back_group(
|
||||
|
||||
ldap_back_map( &li->targets[ candidate ]->oc_map,
|
||||
&group_oc_name, &group_oc_name, BACKLDAP_MAP );
|
||||
if ( group_oc_name.bv_val == NULL ) {
|
||||
if ( group_oc_name.bv_val == NULL || group_oc_name.bv_val[0] == '\0' ) {
|
||||
goto cleanup;
|
||||
}
|
||||
ldap_back_map( &li->targets[ candidate ]->at_map,
|
||||
&group_at_name, &group_at_name, BACKLDAP_MAP );
|
||||
if ( group_at_name.bv_val == NULL ) {
|
||||
if ( group_at_name.bv_val == NULL || group_at_name.bv_val[0] == '\0' ) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
@ -160,7 +160,7 @@ meta_back_modify(
|
||||
ldap_back_map( &li->targets[ candidate ]->at_map,
|
||||
&ml->sml_desc->ad_cname, &mapped,
|
||||
BACKLDAP_MAP );
|
||||
if ( mapped.bv_val == NULL ) {
|
||||
if ( mapped.bv_val == NULL || mapped.bv_val[0] == '\0' ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user