static slap_cf_aux_table bindkey[] = {
{ BER_BVC("uri="), offsetof(slap_bindconf, sb_uri), 'b', 1, NULL },
- { BER_BVC("starttls="), offsetof(slap_bindconf, sb_tls), 'd', 0, tlskey },
- { BER_BVC("bindmethod="), offsetof(slap_bindconf, sb_method), 'd', 0, methkey },
- { BER_BVC("binddn="), offsetof(slap_bindconf, sb_binddn), 'b', 1, NULL },
+ { BER_BVC("starttls="), offsetof(slap_bindconf, sb_tls), 'i', 0, tlskey },
+ { BER_BVC("bindmethod="), offsetof(slap_bindconf, sb_method), 'i', 0, methkey },
+ { BER_BVC("binddn="), offsetof(slap_bindconf, sb_binddn), 'b', 1, dnNormalize },
{ BER_BVC("credentials="), offsetof(slap_bindconf, sb_cred), 'b', 1, NULL },
{ BER_BVC("saslmech="), offsetof(slap_bindconf, sb_saslmech), 'b', 0, NULL },
{ BER_BVC("secprops="), offsetof(slap_bindconf, sb_secprops), 's', 0, NULL },
{ BER_BVC("realm="), offsetof(slap_bindconf, sb_realm), 'b', 0, NULL },
+#ifndef SLAP_AUTHZ_SYNTAX
{ BER_BVC("authcID="), offsetof(slap_bindconf, sb_authcId), 'b', 0, NULL },
{ BER_BVC("authzID="), offsetof(slap_bindconf, sb_authzId), 'b', 1, NULL },
+#else /* SLAP_AUTHZ_SYNTAX */
+ { BER_BVC("authcID="), offsetof(slap_bindconf, sb_authcId), 'b', 0, authzNormalize },
+ { BER_BVC("authzID="), offsetof(slap_bindconf, sb_authzId), 'b', 1, authzNormalize },
+#endif /* SLAP_AUTHZ_SYNTAX */
+
{ BER_BVNULL, 0, 0, 0, NULL }
};
case 'b':
bptr = (struct berval *)((char *)dst + tab->off);
- ber_str2bv( val, 0, 1, bptr );
- break;
+ if ( tab->aux != NULL ) {
+ struct berval dn;
+ slap_mr_normalize_func *normalize = (slap_mr_normalize_func *)tab->aux;
- case 'd':
- assert( tab->aux != NULL );
- iptr = (int *)((char *)dst + tab->off);
+ ber_str2bv( val, 0, 0, &dn );
+ rc = normalize( 0, NULL, NULL, &dn, bptr, NULL );
- rc = 1;
- for ( j = 0; !BER_BVISNULL( &tab->aux[j].word ); j++ ) {
- if ( !strcasecmp( val, tab->aux[j].word.bv_val ) ) {
- *iptr = tab->aux[j].mask;
- rc = 0;
- }
+ } else {
+ ber_str2bv( val, 0, 1, bptr );
+ rc = 0;
}
break;
case 'i':
iptr = (int *)((char *)dst + tab->off);
- rc = lutil_atoix( iptr, val, 0 );
+ if ( tab->aux != NULL ) {
+ slap_verbmasks *aux = (slap_verbmasks *)tab->aux;
+
+ assert( aux != NULL );
+
+ rc = 1;
+ for ( j = 0; !BER_BVISNULL( &aux[j].word ); j++ ) {
+ if ( !strcasecmp( val, aux[j].word.bv_val ) ) {
+ *iptr = aux[j].mask;
+ rc = 0;
+ break;
+ }
+ }
+
+ } else {
+ rc = lutil_atoix( iptr, val, 0 );
+ }
break;
case 'u':
case 'b':
bptr = (struct berval *)((char *)src + tab->off);
cptr = &bptr->bv_val;
+
case 's':
if ( *cptr ) {
*ptr++ = ' ';
}
break;
- case 'd':
- assert( tab->aux != NULL );
+ case 'i':
iptr = (int *)((char *)src + tab->off);
-
- for ( i = 0; !BER_BVISNULL( &tab->aux[i].word ); i++ ) {
- if ( *iptr == tab->aux[i].mask ) {
- *ptr++ = ' ';
- ptr = lutil_strcopy( ptr, tab->key.bv_val );
- ptr = lutil_strcopy( ptr, tab->aux[i].word.bv_val );
- break;
+
+ if ( tab->aux != NULL ) {
+ slap_verbmasks *aux = (slap_verbmasks *)tab->aux;
+
+ for ( i = 0; !BER_BVISNULL( &aux[i].word ); i++ ) {
+ if ( *iptr == aux[i].mask ) {
+ *ptr++ = ' ';
+ ptr = lutil_strcopy( ptr, tab->key.bv_val );
+ ptr = lutil_strcopy( ptr, aux[i].word.bv_val );
+ break;
+ }
}
- }
- break;
- case 'i':
- iptr = (int *)((char *)src + tab->off);
- *ptr++ = ' ';
- ptr = lutil_strcopy( ptr, tab->key.bv_val );
- ptr += snprintf( ptr, sizeof( buf ) - ( ptr - buf ), "%d", *iptr );
+ } else {
+ *ptr++ = ' ';
+ ptr = lutil_strcopy( ptr, tab->key.bv_val );
+ ptr += snprintf( ptr, sizeof( buf ) - ( ptr - buf ), "%d", *iptr );
+ }
break;
case 'u':