1 /* $NetBSD: rdnval.c,v 1.1.1.1 2010/12/12 15:19:15 adam Exp $ */ 2 3 /* rdnval.c - RDN value overlay */ 4 /* OpenLDAP: pkg/ldap/contrib/slapd-modules/samba4/rdnval.c,v 1.1.2.2 2010/04/21 20:13:23 quanah Exp */ 5 /* This work is part of OpenLDAP Software <http://www.openldap.org/>. 6 * 7 * Copyright 1998-2009 The OpenLDAP Foundation. 8 * Portions Copyright 2008 Pierangelo Masarati. 9 * All rights reserved. 10 * 11 * Redistribution and use in source and binary forms, with or without 12 * modification, are permitted only as authorized by the OpenLDAP 13 * Public License. 14 * 15 * A copy of this license is available in the file LICENSE in the 16 * top-level directory of the distribution or, alternatively, at 17 * <http://www.OpenLDAP.org/license.html>. 18 */ 19 /* ACKNOWLEDGEMENTS: 20 * This work was initially developed by Pierangelo Masarati 21 * for inclusion in OpenLDAP Software. 22 */ 23 24 #include "portable.h" 25 26 #ifdef SLAPD_OVER_RDNVAL 27 28 #include <stdio.h> 29 30 #include "ac/string.h" 31 #include "ac/socket.h" 32 33 #include "slap.h" 34 #include "config.h" 35 36 #include "lutil.h" 37 38 /* 39 * Maintain an attribute (rdnValue) that contains the values of each AVA 40 * that builds up the RDN of an entry. This is required for interoperation 41 * with Samba4. It mimics the "name" attribute provided by Active Directory. 42 * The naming attributes must be directoryString-valued, or compatible. 43 * For example, IA5String values are cast into directoryString unless 44 * consisting of the empty string (""). 45 */ 46 47 static AttributeDescription *ad_rdnValue; 48 static Syntax *syn_IA5String; 49 50 static slap_overinst rdnval; 51 52 static int 53 rdnval_is_valid( AttributeDescription *desc, struct berval *value ) 54 { 55 if ( desc->ad_type->sat_syntax == slap_schema.si_syn_directoryString ) { 56 return 1; 57 } 58 59 if ( desc->ad_type->sat_syntax == syn_IA5String 60 && !BER_BVISEMPTY( value ) ) 61 { 62 return 1; 63 } 64 65 return 0; 66 } 67 68 static int 69 rdnval_unique_check_cb( Operation *op, SlapReply *rs ) 70 { 71 if ( rs->sr_type == REP_SEARCH ) { 72 int *p = (int *)op->o_callback->sc_private; 73 (*p)++; 74 } 75 76 return 0; 77 } 78 79 static int 80 rdnval_unique_check( Operation *op, BerVarray vals ) 81 { 82 slap_overinst *on = (slap_overinst *)op->o_bd->bd_info; 83 84 BackendDB db = *op->o_bd; 85 Operation op2 = *op; 86 SlapReply rs2 = { 0 }; 87 int i; 88 BerVarray fvals; 89 char *ptr; 90 int gotit = 0; 91 slap_callback cb = { 0 }; 92 93 /* short-circuit attempts to add suffix entry */ 94 if ( op->o_tag == LDAP_REQ_ADD 95 && be_issuffix( op->o_bd, &op->o_req_ndn ) ) 96 { 97 return LDAP_SUCCESS; 98 } 99 100 op2.o_bd = &db; 101 op2.o_bd->bd_info = (BackendInfo *)on->on_info; 102 op2.o_tag = LDAP_REQ_SEARCH; 103 op2.o_dn = op->o_bd->be_rootdn; 104 op2.o_ndn = op->o_bd->be_rootndn; 105 op2.o_callback = &cb; 106 cb.sc_response = rdnval_unique_check_cb; 107 cb.sc_private = (void *)&gotit; 108 109 dnParent( &op->o_req_ndn, &op2.o_req_dn ); 110 op2.o_req_ndn = op2.o_req_dn; 111 112 op2.ors_limit = NULL; 113 op2.ors_slimit = 1; 114 op2.ors_tlimit = SLAP_NO_LIMIT; 115 op2.ors_attrs = slap_anlist_no_attrs; 116 op2.ors_attrsonly = 1; 117 op2.ors_deref = LDAP_DEREF_NEVER; 118 op2.ors_scope = LDAP_SCOPE_ONELEVEL; 119 120 for ( i = 0; !BER_BVISNULL( &vals[ i ] ); i++ ) 121 /* just count */ ; 122 123 fvals = op->o_tmpcalloc( sizeof( struct berval ), i + 1, 124 op->o_tmpmemctx ); 125 126 op2.ors_filterstr.bv_len = 0; 127 if ( i > 1 ) { 128 op2.ors_filterstr.bv_len = STRLENOF( "(&)" ); 129 } 130 131 for ( i = 0; !BER_BVISNULL( &vals[ i ] ); i++ ) { 132 ldap_bv2escaped_filter_value_x( &vals[ i ], &fvals[ i ], 133 1, op->o_tmpmemctx ); 134 op2.ors_filterstr.bv_len += ad_rdnValue->ad_cname.bv_len 135 + fvals[ i ].bv_len + STRLENOF( "(=)" ); 136 } 137 138 op2.ors_filterstr.bv_val = op->o_tmpalloc( op2.ors_filterstr.bv_len + 1, op->o_tmpmemctx ); 139 140 ptr = op2.ors_filterstr.bv_val; 141 if ( i > 1 ) { 142 ptr = lutil_strcopy( ptr, "(&" ); 143 } 144 for ( i = 0; !BER_BVISNULL( &vals[ i ] ); i++ ) { 145 *ptr++ = '('; 146 ptr = lutil_strncopy( ptr, ad_rdnValue->ad_cname.bv_val, ad_rdnValue->ad_cname.bv_len ); 147 *ptr++ = '='; 148 ptr = lutil_strncopy( ptr, fvals[ i ].bv_val, fvals[ i ].bv_len ); 149 *ptr++ = ')'; 150 } 151 152 if ( i > 1 ) { 153 *ptr++ = ')'; 154 } 155 *ptr = '\0'; 156 157 assert( ptr == op2.ors_filterstr.bv_val + op2.ors_filterstr.bv_len ); 158 op2.ors_filter = str2filter_x( op, op2.ors_filterstr.bv_val ); 159 assert( op2.ors_filter != NULL ); 160 161 (void)op2.o_bd->be_search( &op2, &rs2 ); 162 163 filter_free_x( op, op2.ors_filter, 1 ); 164 op->o_tmpfree( op2.ors_filterstr.bv_val, op->o_tmpmemctx ); 165 for ( i = 0; !BER_BVISNULL( &vals[ i ] ); i++ ) { 166 if ( vals[ i ].bv_val != fvals[ i ].bv_val ) { 167 op->o_tmpfree( fvals[ i ].bv_val, op->o_tmpmemctx ); 168 } 169 } 170 op->o_tmpfree( fvals, op->o_tmpmemctx ); 171 172 if ( rs2.sr_err != LDAP_SUCCESS || gotit > 0 ) { 173 return LDAP_CONSTRAINT_VIOLATION; 174 } 175 176 return LDAP_SUCCESS; 177 } 178 179 static int 180 rdnval_rdn2vals( 181 Operation *op, 182 SlapReply *rs, 183 struct berval *dn, 184 struct berval *ndn, 185 BerVarray *valsp, 186 BerVarray *nvalsp, 187 int *numvalsp ) 188 { 189 LDAPRDN rdn = NULL, nrdn = NULL; 190 int nAVA, i; 191 192 assert( *valsp == NULL ); 193 assert( *nvalsp == NULL ); 194 195 *numvalsp = 0; 196 197 if ( ldap_bv2rdn_x( dn, &rdn, (char **)&rs->sr_text, 198 LDAP_DN_FORMAT_LDAP, op->o_tmpmemctx ) ) 199 { 200 Debug( LDAP_DEBUG_TRACE, 201 "%s rdnval: can't figure out " 202 "type(s)/value(s) of rdn DN=\"%s\"\n", 203 op->o_log_prefix, dn->bv_val, 0 ); 204 rs->sr_err = LDAP_INVALID_DN_SYNTAX; 205 rs->sr_text = "unknown type(s) used in RDN"; 206 207 goto done; 208 } 209 210 if ( ldap_bv2rdn_x( ndn, &nrdn, 211 (char **)&rs->sr_text, LDAP_DN_FORMAT_LDAP, op->o_tmpmemctx ) ) 212 { 213 Debug( LDAP_DEBUG_TRACE, 214 "%s rdnval: can't figure out " 215 "type(s)/value(s) of normalized rdn DN=\"%s\"\n", 216 op->o_log_prefix, ndn->bv_val, 0 ); 217 rs->sr_err = LDAP_INVALID_DN_SYNTAX; 218 rs->sr_text = "unknown type(s) used in RDN"; 219 220 goto done; 221 } 222 223 for ( nAVA = 0; rdn[ nAVA ]; nAVA++ ) 224 /* count'em */ ; 225 226 /* NOTE: we assume rdn and nrdn contain the same AVAs! */ 227 228 *valsp = SLAP_CALLOC( sizeof( struct berval ), nAVA + 1 ); 229 *nvalsp = SLAP_CALLOC( sizeof( struct berval ), nAVA + 1 ); 230 231 /* Add new attribute values to the entry */ 232 for ( i = 0; rdn[ i ]; i++ ) { 233 AttributeDescription *desc = NULL; 234 235 rs->sr_err = slap_bv2ad( &rdn[ i ]->la_attr, 236 &desc, &rs->sr_text ); 237 238 if ( rs->sr_err != LDAP_SUCCESS ) { 239 Debug( LDAP_DEBUG_TRACE, 240 "%s rdnval: %s: %s\n", 241 op->o_log_prefix, 242 rs->sr_text, 243 rdn[ i ]->la_attr.bv_val ); 244 goto done; 245 } 246 247 if ( !rdnval_is_valid( desc, &rdn[ i ]->la_value ) ) { 248 Debug( LDAP_DEBUG_TRACE, 249 "%s rdnval: syntax of naming attribute '%s' " 250 "not compatible with directoryString", 251 op->o_log_prefix, rdn[ i ]->la_attr.bv_val, 0 ); 252 continue; 253 } 254 255 if ( value_find_ex( desc, 256 SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH | 257 SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH, 258 *nvalsp, 259 &nrdn[ i ]->la_value, 260 op->o_tmpmemctx ) 261 == LDAP_NO_SUCH_ATTRIBUTE ) 262 { 263 ber_dupbv( &(*valsp)[ *numvalsp ], &rdn[ i ]->la_value ); 264 ber_dupbv( &(*nvalsp)[ *numvalsp ], &nrdn[ i ]->la_value ); 265 266 (*numvalsp)++; 267 } 268 } 269 270 if ( rdnval_unique_check( op, *valsp ) != LDAP_SUCCESS ) { 271 rs->sr_err = LDAP_CONSTRAINT_VIOLATION; 272 rs->sr_text = "rdnValue not unique within siblings"; 273 goto done; 274 } 275 276 done:; 277 if ( rdn != NULL ) { 278 ldap_rdnfree_x( rdn, op->o_tmpmemctx ); 279 } 280 281 if ( nrdn != NULL ) { 282 ldap_rdnfree_x( nrdn, op->o_tmpmemctx ); 283 } 284 285 if ( rs->sr_err != LDAP_SUCCESS ) { 286 if ( *valsp != NULL ) { 287 ber_bvarray_free( *valsp ); 288 ber_bvarray_free( *nvalsp ); 289 *valsp = NULL; 290 *nvalsp = NULL; 291 *numvalsp = 0; 292 } 293 } 294 295 return rs->sr_err; 296 } 297 298 static int 299 rdnval_op_add( Operation *op, SlapReply *rs ) 300 { 301 Attribute *a, **ap; 302 int numvals = 0; 303 BerVarray vals = NULL, nvals = NULL; 304 int rc; 305 306 /* NOTE: should we accept an entry still in mods format? */ 307 assert( op->ora_e != NULL ); 308 309 if ( BER_BVISEMPTY( &op->ora_e->e_nname ) ) { 310 return SLAP_CB_CONTINUE; 311 } 312 313 a = attr_find( op->ora_e->e_attrs, ad_rdnValue ); 314 if ( a != NULL ) { 315 /* TODO: check consistency? */ 316 return SLAP_CB_CONTINUE; 317 } 318 319 rc = rdnval_rdn2vals( op, rs, &op->ora_e->e_name, &op->ora_e->e_nname, 320 &vals, &nvals, &numvals ); 321 if ( rc != LDAP_SUCCESS ) { 322 send_ldap_result( op, rs ); 323 } 324 325 a = attr_alloc( ad_rdnValue ); 326 327 a->a_vals = vals; 328 a->a_nvals = nvals; 329 a->a_numvals = numvals; 330 331 for ( ap = &op->ora_e->e_attrs; *ap != NULL; ap = &(*ap)->a_next ) 332 /* goto tail */ ; 333 334 *ap = a; 335 336 return SLAP_CB_CONTINUE; 337 } 338 339 static int 340 rdnval_op_rename( Operation *op, SlapReply *rs ) 341 { 342 Modifications *ml, **mlp; 343 int numvals = 0; 344 BerVarray vals = NULL, nvals = NULL; 345 struct berval old; 346 int rc; 347 348 dnRdn( &op->o_req_dn, &old ); 349 if ( dn_match( &old, &op->orr_newrdn ) ) { 350 dnRdn( &op->o_req_ndn, &old ); 351 if ( dn_match( &old, &op->orr_nnewrdn ) ) { 352 return SLAP_CB_CONTINUE; 353 } 354 } 355 356 rc = rdnval_rdn2vals( op, rs, &op->orr_newrdn, &op->orr_nnewrdn, 357 &vals, &nvals, &numvals ); 358 if ( rc != LDAP_SUCCESS ) { 359 send_ldap_result( op, rs ); 360 } 361 362 ml = SLAP_CALLOC( sizeof( Modifications ), 1 ); 363 ml->sml_values = vals; 364 ml->sml_nvalues = nvals; 365 366 ml->sml_numvals = numvals; 367 368 ml->sml_op = LDAP_MOD_REPLACE; 369 ml->sml_flags = SLAP_MOD_INTERNAL; 370 ml->sml_desc = ad_rdnValue; 371 ml->sml_type = ad_rdnValue->ad_cname; 372 373 for ( mlp = &op->orr_modlist; *mlp != NULL; mlp = &(*mlp)->sml_next ) 374 /* goto tail */ ; 375 376 *mlp = ml; 377 378 return SLAP_CB_CONTINUE; 379 } 380 381 static int 382 rdnval_db_init( 383 BackendDB *be, 384 ConfigReply *cr) 385 { 386 if ( SLAP_ISGLOBALOVERLAY( be ) ) { 387 Log0( LDAP_DEBUG_ANY, LDAP_LEVEL_ERR, 388 "rdnval_db_init: rdnval cannot be used as global overlay.\n" ); 389 return 1; 390 } 391 392 if ( be->be_nsuffix == NULL ) { 393 Log0( LDAP_DEBUG_ANY, LDAP_LEVEL_ERR, 394 "rdnval_db_init: database must have suffix\n" ); 395 return 1; 396 } 397 398 if ( BER_BVISNULL( &be->be_rootndn ) || BER_BVISEMPTY( &be->be_rootndn ) ) { 399 Log1( LDAP_DEBUG_ANY, LDAP_LEVEL_ERR, 400 "rdnval_db_init: missing rootdn for database DN=\"%s\", YMMV\n", 401 be->be_suffix[ 0 ].bv_val ); 402 } 403 404 return 0; 405 } 406 407 typedef struct rdnval_mod_t { 408 struct berval ndn; 409 BerVarray vals; 410 BerVarray nvals; 411 int numvals; 412 struct rdnval_mod_t *next; 413 } rdnval_mod_t; 414 415 typedef struct { 416 BackendDB *bd; 417 rdnval_mod_t *mods; 418 } rdnval_repair_cb_t; 419 420 static int 421 rdnval_repair_cb( Operation *op, SlapReply *rs ) 422 { 423 int rc; 424 rdnval_repair_cb_t *rcb = op->o_callback->sc_private; 425 rdnval_mod_t *mod; 426 BerVarray vals = NULL, nvals = NULL; 427 int numvals = 0; 428 ber_len_t len; 429 BackendDB *save_bd = op->o_bd; 430 431 switch ( rs->sr_type ) { 432 case REP_SEARCH: 433 break; 434 435 case REP_SEARCHREF: 436 case REP_RESULT: 437 return rs->sr_err; 438 439 default: 440 assert( 0 ); 441 } 442 443 assert( rs->sr_entry != NULL ); 444 445 op->o_bd = rcb->bd; 446 rc = rdnval_rdn2vals( op, rs, &rs->sr_entry->e_name, &rs->sr_entry->e_nname, 447 &vals, &nvals, &numvals ); 448 op->o_bd = save_bd; 449 if ( rc != LDAP_SUCCESS ) { 450 return 0; 451 } 452 453 len = sizeof( rdnval_mod_t ) + rs->sr_entry->e_nname.bv_len + 1; 454 mod = op->o_tmpalloc( len, op->o_tmpmemctx ); 455 mod->ndn.bv_len = rs->sr_entry->e_nname.bv_len; 456 mod->ndn.bv_val = (char *)&mod[1]; 457 lutil_strncopy( mod->ndn.bv_val, rs->sr_entry->e_nname.bv_val, rs->sr_entry->e_nname.bv_len ); 458 mod->vals = vals; 459 mod->nvals = nvals; 460 mod->numvals = numvals; 461 462 mod->next = rcb->mods; 463 rcb->mods = mod; 464 465 Debug( LDAP_DEBUG_TRACE, "%s: rdnval_repair_cb: scheduling entry DN=\"%s\" for repair\n", 466 op->o_log_prefix, rs->sr_entry->e_name.bv_val, 0 ); 467 468 return 0; 469 } 470 471 static int 472 rdnval_repair( BackendDB *be ) 473 { 474 slap_overinst *on = (slap_overinst *)be->bd_info; 475 void *ctx = ldap_pvt_thread_pool_context(); 476 Connection conn = { 0 }; 477 OperationBuffer opbuf; 478 Operation *op; 479 BackendDB db; 480 slap_callback sc = { 0 }; 481 rdnval_repair_cb_t rcb = { 0 }; 482 SlapReply rs = { REP_RESULT }; 483 rdnval_mod_t *rmod; 484 int nrepaired = 0; 485 486 connection_fake_init2( &conn, &opbuf, ctx, 0 ); 487 op = &opbuf.ob_op; 488 489 op->o_tag = LDAP_REQ_SEARCH; 490 memset( &op->oq_search, 0, sizeof( op->oq_search ) ); 491 492 assert( !BER_BVISNULL( &be->be_nsuffix[ 0 ] ) ); 493 494 op->o_bd = select_backend( &be->be_nsuffix[ 0 ], 0 ); 495 assert( op->o_bd != NULL ); 496 assert( op->o_bd->be_nsuffix != NULL ); 497 498 op->o_req_dn = op->o_bd->be_suffix[ 0 ]; 499 op->o_req_ndn = op->o_bd->be_nsuffix[ 0 ]; 500 501 op->o_dn = op->o_bd->be_rootdn; 502 op->o_ndn = op->o_bd->be_rootndn; 503 504 op->ors_scope = LDAP_SCOPE_SUBTREE; 505 op->ors_tlimit = SLAP_NO_LIMIT; 506 op->ors_slimit = SLAP_NO_LIMIT; 507 op->ors_attrs = slap_anlist_no_attrs; 508 509 op->ors_filterstr.bv_len = STRLENOF( "(!(=*))" ) + ad_rdnValue->ad_cname.bv_len; 510 op->ors_filterstr.bv_val = op->o_tmpalloc( op->ors_filterstr.bv_len + 1, op->o_tmpmemctx ); 511 snprintf( op->ors_filterstr.bv_val, op->ors_filterstr.bv_len + 1, 512 "(!(%s=*))", ad_rdnValue->ad_cname.bv_val ); 513 514 op->ors_filter = str2filter_x( op, op->ors_filterstr.bv_val ); 515 if ( op->ors_filter == NULL ) { 516 rs.sr_err = LDAP_OTHER; 517 goto done_search; 518 } 519 520 op->o_callback = ≻ 521 sc.sc_response = rdnval_repair_cb; 522 sc.sc_private = &rcb; 523 rcb.bd = &db; 524 db = *be; 525 db.bd_info = (BackendInfo *)on; 526 527 (void)op->o_bd->bd_info->bi_op_search( op, &rs ); 528 529 op->o_tag = LDAP_REQ_MODIFY; 530 sc.sc_response = slap_null_cb; 531 sc.sc_private = NULL; 532 memset( &op->oq_modify, 0, sizeof( req_modify_s ) ); 533 534 for ( rmod = rcb.mods; rmod != NULL; ) { 535 rdnval_mod_t *rnext; 536 537 Modifications *mod; 538 SlapReply rs2 = { REP_RESULT }; 539 540 mod = (Modifications *) ch_malloc( sizeof( Modifications ) ); 541 mod->sml_flags = SLAP_MOD_INTERNAL; 542 mod->sml_op = LDAP_MOD_REPLACE; 543 mod->sml_desc = ad_rdnValue; 544 mod->sml_type = ad_rdnValue->ad_cname; 545 mod->sml_values = rmod->vals; 546 mod->sml_nvalues = rmod->nvals; 547 mod->sml_numvals = rmod->numvals; 548 mod->sml_next = NULL; 549 550 op->o_req_dn = rmod->ndn; 551 op->o_req_ndn = rmod->ndn; 552 553 op->orm_modlist = mod; 554 555 op->o_bd->be_modify( op, &rs2 ); 556 557 slap_mods_free( op->orm_modlist, 1 ); 558 if ( rs2.sr_err == LDAP_SUCCESS ) { 559 Debug( LDAP_DEBUG_TRACE, "%s: rdnval_repair: entry DN=\"%s\" repaired\n", 560 op->o_log_prefix, rmod->ndn.bv_val, 0 ); 561 nrepaired++; 562 563 } else { 564 Debug( LDAP_DEBUG_ANY, "%s: rdnval_repair: entry DN=\"%s\" repair failed (%d)\n", 565 op->o_log_prefix, rmod->ndn.bv_val, rs2.sr_err ); 566 } 567 568 rnext = rmod->next; 569 op->o_tmpfree( rmod, op->o_tmpmemctx ); 570 rmod = rnext; 571 } 572 573 done_search:; 574 op->o_tmpfree( op->ors_filterstr.bv_val, op->o_tmpmemctx ); 575 filter_free_x( op, op->ors_filter, 1 ); 576 577 Log1( LDAP_DEBUG_STATS, LDAP_LEVEL_INFO, 578 "rdnval: repaired=%d\n", nrepaired ); 579 580 return 0; 581 } 582 583 /* search all entries without parentUUID; "repair" them */ 584 static int 585 rdnval_db_open( 586 BackendDB *be, 587 ConfigReply *cr ) 588 { 589 if ( SLAP_SINGLE_SHADOW( be ) ) { 590 Log1( LDAP_DEBUG_ANY, LDAP_LEVEL_ERR, 591 "rdnval incompatible with shadow database \"%s\".\n", 592 be->be_suffix[ 0 ].bv_val ); 593 return 1; 594 } 595 596 return rdnval_repair( be ); 597 } 598 599 static struct { 600 char *desc; 601 AttributeDescription **adp; 602 } as[] = { 603 { "( 1.3.6.1.4.1.4203.666.1.58 " 604 "NAME 'rdnValue' " 605 "DESC 'the value of the naming attributes' " 606 "SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' " 607 "EQUALITY caseIgnoreMatch " 608 "USAGE dSAOperation " 609 "NO-USER-MODIFICATION " 610 ")", 611 &ad_rdnValue }, 612 { NULL } 613 }; 614 615 int 616 rdnval_initialize(void) 617 { 618 int code, i; 619 620 for ( i = 0; as[ i ].desc != NULL; i++ ) { 621 code = register_at( as[ i ].desc, as[ i ].adp, 0 ); 622 if ( code ) { 623 Debug( LDAP_DEBUG_ANY, 624 "rdnval_initialize: register_at #%d failed\n", 625 i, 0, 0 ); 626 return code; 627 } 628 629 /* Allow Manager to set these as needed */ 630 if ( is_at_no_user_mod( (*as[ i ].adp)->ad_type ) ) { 631 (*as[ i ].adp)->ad_type->sat_flags |= 632 SLAP_AT_MANAGEABLE; 633 } 634 } 635 636 syn_IA5String = syn_find( "1.3.6.1.4.1.1466.115.121.1.26" ); 637 if ( syn_IA5String == NULL ) { 638 Debug( LDAP_DEBUG_ANY, 639 "rdnval_initialize: unable to find syntax '1.3.6.1.4.1.1466.115.121.1.26' (IA5String)\n", 640 0, 0, 0 ); 641 return LDAP_OTHER; 642 } 643 644 rdnval.on_bi.bi_type = "rdnval"; 645 646 rdnval.on_bi.bi_op_add = rdnval_op_add; 647 rdnval.on_bi.bi_op_modrdn = rdnval_op_rename; 648 649 rdnval.on_bi.bi_db_init = rdnval_db_init; 650 rdnval.on_bi.bi_db_open = rdnval_db_open; 651 652 return overlay_register( &rdnval ); 653 } 654 655 #if SLAPD_OVER_RDNVAL == SLAPD_MOD_DYNAMIC 656 int 657 init_module( int argc, char *argv[] ) 658 { 659 return rdnval_initialize(); 660 } 661 #endif /* SLAPD_OVER_RDNVAL == SLAPD_MOD_DYNAMIC */ 662 663 #endif /* SLAPD_OVER_RDNVAL */ 664