- } else if( strcasecmp( cargv[i], "tls_2_anon" ) == 0 ) {
- disallows |= SLAP_DISALLOW_TLS_2_ANON;
-
- } else if( strcasecmp( cargv[i], "tls_authc" ) == 0 ) {
- disallows |= SLAP_DISALLOW_TLS_AUTHC;
-
- } else {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: unknown feature %s in "
- "\"disallow <features>\" line.\n",
- fname, lineno, cargv[i] );
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: unknown feature %s in \"disallow <features>\" line\n",
- fname, lineno, cargv[i] );
-#endif
-
- return 1;
- }
- }
-
- global_disallows |= disallows;
-
- /* require these features */
- } else if ( strcasecmp( cargv[0], "requires" ) == 0 ||
- strcasecmp( cargv[0], "require" ) == 0 )
- {
- slap_mask_t requires = 0;
-
- if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing feature(s) in "
- "\"require <features>\" line.\n", fname, lineno ,0 );
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: missing feature(s) in \"require <features>\" line\n",
- fname, lineno, 0 );
-#endif
-
- return( 1 );
- }
-
- for( i=1; i < cargc; i++ ) {
- if( strcasecmp( cargv[i], "bind" ) == 0 ) {
- requires |= SLAP_REQUIRE_BIND;
-
- } else if( strcasecmp( cargv[i], "LDAPv3" ) == 0 ) {
- requires |= SLAP_REQUIRE_LDAP_V3;
-
- } else if( strcasecmp( cargv[i], "authc" ) == 0 ) {
- requires |= SLAP_REQUIRE_AUTHC;
-
- } else if( strcasecmp( cargv[i], "SASL" ) == 0 ) {
- requires |= SLAP_REQUIRE_SASL;
-
- } else if( strcasecmp( cargv[i], "strong" ) == 0 ) {
- requires |= SLAP_REQUIRE_STRONG;
-
- } else if( strcasecmp( cargv[i], "none" ) != 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: unknown feature %s in "
- "\"require <features>\" line.\n",
- fname, lineno , cargv[i] );
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: unknown feature %s in \"require <features>\" line\n",
- fname, lineno, cargv[i] );
-#endif
-
- return( 1 );
- }
- }
-
- if ( be == NULL ) {
- frontendDB->be_requires = requires;
- } else {
- be->be_requires = requires;
- }
-
- /* required security factors */
- } else if ( strcasecmp( cargv[0], "security" ) == 0 ) {
- slap_ssf_set_t *set;
-
- if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing factor(s) in \"security <factors>\""
- " line.\n", fname, lineno ,0 );
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: missing factor(s) in \"security <factors>\" line\n",
- fname, lineno, 0 );
-#endif
-
- return( 1 );
- }
-
- if ( be == NULL ) {
- set = &frontendDB->be_ssf_set;
- } else {
- set = &be->be_ssf_set;
- }
-
- for( i=1; i < cargc; i++ ) {
- slap_ssf_t *tgt;
- char *src;
-
- if ( strncasecmp( cargv[i], "ssf=",
- STRLENOF("ssf=") ) == 0 )
- {
- tgt = &set->sss_ssf;
- src = &cargv[i][STRLENOF("ssf=")];
-
- } else if ( strncasecmp( cargv[i], "transport=",
- STRLENOF("transport=") ) == 0 )
- {
- tgt = &set->sss_transport;
- src = &cargv[i][STRLENOF("transport=")];
-
- } else if ( strncasecmp( cargv[i], "tls=",
- STRLENOF("tls=") ) == 0 )
- {
- tgt = &set->sss_tls;
- src = &cargv[i][STRLENOF("tls=")];
-
- } else if ( strncasecmp( cargv[i], "sasl=",
- STRLENOF("sasl=") ) == 0 )
- {
- tgt = &set->sss_sasl;
- src = &cargv[i][STRLENOF("sasl=")];
-
- } else if ( strncasecmp( cargv[i], "update_ssf=",
- STRLENOF("update_ssf=") ) == 0 )
- {
- tgt = &set->sss_update_ssf;
- src = &cargv[i][STRLENOF("update_ssf=")];
-
- } else if ( strncasecmp( cargv[i], "update_transport=",
- STRLENOF("update_transport=") ) == 0 )
- {
- tgt = &set->sss_update_transport;
- src = &cargv[i][STRLENOF("update_transport=")];
-
- } else if ( strncasecmp( cargv[i], "update_tls=",
- STRLENOF("update_tls=") ) == 0 )
- {
- tgt = &set->sss_update_tls;
- src = &cargv[i][STRLENOF("update_tls=")];
-
- } else if ( strncasecmp( cargv[i], "update_sasl=",
- STRLENOF("update_sasl=") ) == 0 )
- {
- tgt = &set->sss_update_sasl;
- src = &cargv[i][STRLENOF("update_sasl=")];
-
- } else if ( strncasecmp( cargv[i], "simple_bind=",
- STRLENOF("simple_bind=") ) == 0 )
- {
- tgt = &set->sss_simple_bind;
- src = &cargv[i][STRLENOF("simple_bind=")];
-
- } else {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: unknown factor %s in "
- "\"security <factors>\" line.\n",
- fname, lineno, cargv[1] );
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: unknown factor %s in \"security <factors>\" line\n",
- fname, lineno, cargv[i] );
-#endif
-
- return( 1 );
- }
-
- *tgt = strtol( src, &next, 10 );
- if ( next == NULL || next[0] != '\0' ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: unable to parse factor \"%s\" in "
- "\"security <factors>\" line.\n",
- fname, lineno, cargv[1] );
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: unable to parse factor \"%s\" in \"security <factors>\" line\n",
- fname, lineno, cargv[i] );
-#endif
-
- return( 1 );
- }
- }
-
- /* where to send clients when we don't hold it */
- } else if ( strcasecmp( cargv[0], "referral" ) == 0 ) {
- if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing URL in \"referral <URL>\""
- " line.\n", fname, lineno , 0 );
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: missing URL in \"referral <URL>\" line\n",
- fname, lineno, 0 );
-#endif
-
- return( 1 );
- }
-
- if( validate_global_referral( cargv[1] ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: invalid URL (%s) in \"referral\" line.\n",
- fname, lineno, cargv[1] );
-#else
- Debug( LDAP_DEBUG_ANY, "%s: line %d: "
- "invalid URL (%s) in \"referral\" line.\n",
- fname, lineno, cargv[1] );
-#endif
- return 1;
- }
-
- vals[0].bv_val = cargv[1];
- vals[0].bv_len = strlen( vals[0].bv_val );
- if( value_add( &default_referral, vals ) )
- return LDAP_OTHER;
-
-#ifdef NEW_LOGGING
- } else if ( strcasecmp( cargv[0], "logfile" ) == 0 ) {
- FILE *logfile;
- if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: Error in logfile directive, "
- "\"logfile <filename>\"\n", fname, lineno , 0 );
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: Error in logfile directive, \"logfile filename\"\n",
- fname, lineno, 0 );
-#endif
-
- return( 1 );
- }
- logfile = fopen( cargv[1], "w" );
- if ( logfile != NULL ) lutil_debug_file( logfile );
-
-#endif
- /* start of a new database definition */
- } else if ( strcasecmp( cargv[0], "debug" ) == 0 ) {
- int level;
- if ( cargc < 3 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: Error in debug directive, "
- "\"debug <subsys> <level>\"\n", fname, lineno , 0 );
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: Error in debug directive, \"debug subsys level\"\n",
- fname, lineno, 0 );
-#endif
- return( 1 );
- }
- level = strtol( cargv[2], &next, 10 );
- if ( next == NULL || next[0] != '\0' ){
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: unable to parse level \"%s\" in debug directive, "
- "\"debug <subsys> <level>\"\n", fname, lineno , cargv[2] );
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: unable to parse level \"%s\" in debug directive, "
- "\"debug <subsys> <level>\"\n", fname, lineno , cargv[2] );
-#endif
- return( 1 );
- }
-
- if ( level <= 0 ) level = lutil_mnem2level( cargv[2] );
- lutil_set_debug_level( cargv[1], level );
- /* specify an Object Identifier macro */
- } else if ( strcasecmp( cargv[0], "objectidentifier" ) == 0 ) {
- rc = parse_oidm( fname, lineno, cargc, cargv );
- if( rc ) return rc;
-
- /* specify an objectclass */
- } else if ( strcasecmp( cargv[0], "objectclass" ) == 0 ) {
- if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: illegal objectclass format.\n",
- fname, lineno , 0 );
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: illegal objectclass format.\n",
- fname, lineno, 0 );
-#endif
- return( 1 );
-
- } else if ( *cargv[1] == '(' /*')'*/) {
- char * p;
- p = strchr(saveline,'(' /*')'*/);
- rc = parse_oc( fname, lineno, p, cargv );
- if( rc ) return rc;
-
- } else {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: old objectclass format not supported\n",
- fname, lineno , 0 );
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: old objectclass format not supported.\n",
- fname, lineno, 0 );
-#endif
- }
-
- } else if ( strcasecmp( cargv[0], "ditcontentrule" ) == 0 ) {
- char * p;
- p = strchr(saveline,'(' /*')'*/);
- rc = parse_cr( fname, lineno, p, cargv );
- if( rc ) return rc;
-
- /* specify an attribute type */
- } else if (( strcasecmp( cargv[0], "attributetype" ) == 0 )
- || ( strcasecmp( cargv[0], "attribute" ) == 0 ))
- {
- if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO, "%s: line %d: "
- "illegal attribute type format.\n",
- fname, lineno , 0 );
-#else
- Debug( LDAP_DEBUG_ANY, "%s: line %d: "
- "illegal attribute type format.\n",
- fname, lineno, 0 );
-#endif
- return( 1 );
-
- } else if ( *cargv[1] == '(' /*')'*/) {
- char * p;
- p = strchr(saveline,'(' /*')'*/);
- rc = parse_at( fname, lineno, p, cargv );
- if( rc ) return rc;
-
- } else {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: old attribute type format not supported.\n",
- fname, lineno , 0 );
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: old attribute type format not supported.\n",
- fname, lineno, 0 );
-#endif
-
- }
-
- /* define attribute option(s) */
- } else if ( strcasecmp( cargv[0], "attributeoptions" ) == 0 ) {
- ad_define_option( NULL, NULL, 0 );
- for ( i = 1; i < cargc; i++ )
- if ( ad_define_option( cargv[i], fname, lineno ) != 0 )
- return 1;
-
- /* turn on/off schema checking */
- } else if ( strcasecmp( cargv[0], "schemacheck" ) == 0 ) {
- if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing on|off in \"schemacheck <on|off>\""
- " line.\n", fname, lineno , 0 );
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: missing on|off in \"schemacheck <on|off>\" line\n",
- fname, lineno, 0 );
-#endif
-
- return( 1 );
- }
- if ( strcasecmp( cargv[1], "off" ) == 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: schema checking disabled! your mileage may "
- "vary!\n", fname, lineno , 0 );
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: schema checking disabled! your mileage may vary!\n",
- fname, lineno, 0 );
-#endif
- global_schemacheck = 0;
- } else {
- global_schemacheck = 1;
- }
-
- /* specify access control info */
- } else if ( strcasecmp( cargv[0], "access" ) == 0 ) {
- parse_acl( be, fname, lineno, cargc, cargv );
-
- /* debug level to log things to syslog */
- } else if ( strcasecmp( cargv[0], "loglevel" ) == 0 ) {
- if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing level(s) in \"loglevel <level> [...]\""
- " line.\n", fname, lineno , 0 );
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: missing level(s) in \"loglevel <level> [...]\" line\n",
- fname, lineno, 0 );
-#endif
-
- return( 1 );
- }
-
- ldap_syslog = 0;
-
- for( i=1; i < cargc; i++ ) {
- int level;
-
- if ( isdigit( cargv[i][0] ) ) {
- level = strtol( cargv[i], &next, 10 );
- if ( next == NULL || next[0] != '\0' ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: unable to parse level \"%s\" "
- "in \"loglevel <level> [...]\" line.\n",
- fname, lineno , cargv[i] );
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: unable to parse level \"%s\" "
- "in \"loglevel <level> [...]\" line.\n",
- fname, lineno , cargv[i] );
-#endif
- return( 1 );
- }
-
- } else {
- static struct {
- int i;
- char *s;
- } int_2_level[] = {
- { LDAP_DEBUG_TRACE, "Trace" },
- { LDAP_DEBUG_PACKETS, "Packets" },
- { LDAP_DEBUG_ARGS, "Args" },
- { LDAP_DEBUG_CONNS, "Conns" },
- { LDAP_DEBUG_BER, "BER" },
- { LDAP_DEBUG_FILTER, "Filter" },
- { LDAP_DEBUG_CONFIG, "Config" },
- { LDAP_DEBUG_ACL, "ACL" },
- { LDAP_DEBUG_STATS, "Stats" },
- { LDAP_DEBUG_STATS2, "Stats2" },
- { LDAP_DEBUG_SHELL, "Shell" },
- { LDAP_DEBUG_PARSE, "Parse" },
- { LDAP_DEBUG_CACHE, "Cache" },
- { LDAP_DEBUG_INDEX, "Index" },
- { -1, "Any" },
- { 0, NULL }
- };
- int j;
-
- for ( j = 0; int_2_level[j].s; j++ ) {
- if ( strcasecmp( cargv[i], int_2_level[j].s ) == 0 ) {
- level = int_2_level[j].i;
- break;
- }
- }
-
- if ( int_2_level[j].s == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: unknown level \"%s\" "
- "in \"loglevel <level> [...]\" line.\n",
- fname, lineno , cargv[i] );
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: unknown level \"%s\" "
- "in \"loglevel <level> [...]\" line.\n",
- fname, lineno , cargv[i] );
-#endif
- return( 1 );
- }
- }
-
- ldap_syslog |= level;
- }
-
- /* list of sync replication information in this backend (slave only) */
- } else if ( strcasecmp( cargv[0], "syncrepl" ) == 0 ) {
-
- if ( be == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: syncrepl line must appear inside "
- "a database definition.\n", fname, lineno, 0);
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: syncrepl line must appear inside "
- "a database definition.\n", fname, lineno, 0);
-#endif
- return 1;
-
- } else if ( SLAP_SHADOW( be )) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: syncrepl: database already shadowed.\n",
- fname, lineno, 0);
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: syncrepl: database already shadowed.\n",
- fname, lineno, 0);
-#endif
- return 1;
-
- } else if ( add_syncrepl( be, cargv, cargc )) {
- return 1;
- }
-
- SLAP_DBFLAGS(be) |= ( SLAP_DBFLAG_SHADOW | SLAP_DBFLAG_SYNC_SHADOW );
-
- /* list of replicas of the data in this backend (master only) */
- } else if ( strcasecmp( cargv[0], "replica" ) == 0 ) {
- if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing host or uri in \"replica "
- " <host[:port]\" line\n", fname, lineno , 0 );
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: missing host or uri in \"replica <host[:port]>\" line\n",
- fname, lineno, 0 );
-#endif
-
- return( 1 );
- }
- if ( be == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: replica line must appear inside "
- "a database definition.\n", fname, lineno, 0);
-#else
- Debug( LDAP_DEBUG_ANY,
-"%s: line %d: replica line must appear inside a database definition\n",
- fname, lineno, 0 );
-#endif
- return 1;
-
- } else {
- int nr = -1;
-
- for ( i = 1; i < cargc; i++ ) {
- if ( strncasecmp( cargv[i], "host=", 5 )
- == 0 ) {
- nr = add_replica_info( be,
- cargv[i] + 5 );
- break;
- } else if (strncasecmp( cargv[i], "uri=", 4 )
- == 0 ) {
- if ( ldap_url_parse( cargv[ i ] + 4, &ludp )
- != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: replica line contains invalid "
- "uri definition.\n", fname, lineno, 0);
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: replica line contains invalid "
- "uri definition.\n", fname, lineno, 0);
-#endif
- return 1;
- }
- if (ludp->lud_host == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: replica line contains invalid "
- "uri definition - missing hostname.\n",
- fname, lineno, 0);
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: replica line contains invalid "
- "uri definition - missing hostname.\n", fname, lineno, 0);
-#endif
- return 1;
- }
- replicahost = ch_malloc( strlen( cargv[ i ] ) );
- if ( replicahost == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, ERR,
- "out of memory in read_config\n", 0, 0,0 );
-#else
- Debug( LDAP_DEBUG_ANY,
- "out of memory in read_config\n", 0, 0, 0 );
-#endif
- ldap_free_urldesc( ludp );
- exit( EXIT_FAILURE );
- }
- sprintf(replicahost, "%s:%d",
- ludp->lud_host, ludp->lud_port);
- nr = add_replica_info( be, replicahost );
- ldap_free_urldesc( ludp );
- ch_free(replicahost);
- break;
- }
- }
- if ( i == cargc ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: missing host or uri in \"replica\" line\n",
- fname, lineno , 0 );
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: missing host or uri in \"replica\" line\n",
- fname, lineno, 0 );
-#endif
- return 1;
-
- } else if ( nr == -1 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: unable to add"
- " replica \"%s\"\n",
- fname, lineno,
- cargv[i] + 5 );
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: unable to add replica \"%s\"\n",
- fname, lineno, cargv[i] + 5 );
-#endif
- return 1;
- } else {
- for ( i = 1; i < cargc; i++ ) {
- if ( strncasecmp( cargv[i], "suffix=", 7 ) == 0 ) {
-
- switch ( add_replica_suffix( be, nr, cargv[i] + 7 ) ) {
- case 1:
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: suffix \"%s\" in \"replica\""
- " line is not valid for backend(ignored)\n",
- fname, lineno, cargv[i] + 7 );
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: suffix \"%s\" in \"replica\" line is not valid for backend (ignored)\n",
- fname, lineno, cargv[i] + 7 );
-#endif
- break;
-
- case 2:
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: unable to normalize suffix"
- " in \"replica\" line (ignored)\n",
- fname, lineno , 0 );
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: unable to normalize suffix in \"replica\" line (ignored)\n",
- fname, lineno, 0 );
-#endif
- break;
- }
-
- } else if ( strncasecmp( cargv[i], "attr", 4 ) == 0 ) {
- int exclude = 0;
- char *arg = cargv[i] + 4;
-
- if ( arg[0] == '!' ) {
- arg++;
- exclude = 1;
- }
-
- if ( arg[0] != '=' ) {
- continue;
- }
-
- if ( add_replica_attrs( be, nr, arg + 1, exclude ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: attribute \"%s\" in "
- "\"replica\" line is unknown\n",
- fname, lineno, arg + 1 );
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: attribute \"%s\" in \"replica\" line is unknown\n",
- fname, lineno, arg + 1 );
-#endif
- return( 1 );
- }
- }
- }
- }
- }
-
- } else if ( strcasecmp( cargv[0], "replicationInterval" ) == 0 ) {
- /* ignore */
-
- /* dn of slave entity allowed to write to replica */
- } else if ( strcasecmp( cargv[0], "updatedn" ) == 0 ) {
- if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing dn in \"updatedn <dn>\""
- " line.\n", fname, lineno , 0 );
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: missing dn in \"updatedn <dn>\" line\n",
- fname, lineno, 0 );
-#endif
-
- return( 1 );
- }
- if ( be == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: updatedn line must appear inside "
- "a database definition\n",
- fname, lineno , 0 );
-#else
- Debug( LDAP_DEBUG_ANY,
-"%s: line %d: updatedn line must appear inside a database definition\n",
- fname, lineno, 0 );
-#endif
- return 1;
-
- } else if ( SLAP_SHADOW(be) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: updatedn: database already shadowed.\n",
- fname, lineno, 0);
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: updatedn: database already shadowed.\n",
- fname, lineno, 0);
-#endif
- return 1;
-
- } else {
- struct berval dn;
-
- if ( load_ucdata( NULL ) < 0 ) return 1;
-
- dn.bv_val = cargv[1];
- dn.bv_len = strlen( cargv[1] );
-
- rc = dnNormalize( 0, NULL, NULL, &dn, &be->be_update_ndn, NULL );
- if( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: updatedn DN is invalid.\n",
- fname, lineno , 0 );
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: updatedn DN is invalid\n",
- fname, lineno, 0 );
-#endif
- return 1;
- }
-
- }
- SLAP_DBFLAGS(be) |= ( SLAP_DBFLAG_SHADOW | SLAP_DBFLAG_SLURP_SHADOW );
-
- } else if ( strcasecmp( cargv[0], "updateref" ) == 0 ) {
- if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT, "%s: line %d: "
- "missing url in \"updateref <ldapurl>\" line.\n",
- fname, lineno , 0 );
-#else
- Debug( LDAP_DEBUG_ANY, "%s: line %d: "
- "missing url in \"updateref <ldapurl>\" line\n",
- fname, lineno, 0 );
-#endif
-
- return( 1 );
- }
- if ( be == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO, "%s: line %d: updateref"
- " line must appear inside a database definition\n",
- fname, lineno , 0 );
-#else
- Debug( LDAP_DEBUG_ANY, "%s: line %d: updateref"
- " line must appear inside a database definition\n",
- fname, lineno, 0 );
-#endif
- return 1;
-
- } else if ( !SLAP_SHADOW(be) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO, "%s: line %d: "
- "updateref line must come after syncrepl or updatedn.\n",
- fname, lineno , 0 );
-#else
- Debug( LDAP_DEBUG_ANY, "%s: line %d: "
- "updateref line must after syncrepl or updatedn.\n",
- fname, lineno, 0 );
-#endif
- return 1;
- }
-
- if( validate_global_referral( cargv[1] ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT, "%s: line %d: "
- "invalid URL (%s) in \"updateref\" line.\n",
- fname, lineno, cargv[1] );
-#else
- Debug( LDAP_DEBUG_ANY, "%s: line %d: "
- "invalid URL (%s) in \"updateref\" line.\n",
- fname, lineno, cargv[1] );
-#endif
- return 1;
- }
-
- vals[0].bv_val = cargv[1];
- vals[0].bv_len = strlen( vals[0].bv_val );
- if( value_add( &be->be_update_refs, vals ) ) {
- return LDAP_OTHER;
- }
-
- /* replication log file to which changes are appended */
- } else if ( strcasecmp( cargv[0], "replogfile" ) == 0 ) {
- if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing filename in \"replogfile <filename>\""
- " line.\n", fname, lineno , 0 );
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: missing filename in \"replogfile <filename>\" line\n",
- fname, lineno, 0 );
-#endif
-
- return( 1 );
- }
- if ( be ) {
- be->be_replogfile = ch_strdup( cargv[1] );
- } else {
- replogfile = ch_strdup( cargv[1] );
- }
-
- /* file from which to read additional rootdse attrs */
- } else if ( strcasecmp( cargv[0], "rootDSE" ) == 0) {
- if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT, "%s: line %d: "
- "missing filename in \"rootDSE <filename>\" line.\n",
- fname, lineno , 0 );
-#else
- Debug( LDAP_DEBUG_ANY, "%s: line %d: "
- "missing filename in \"rootDSE <filename>\" line.\n",
- fname, lineno, 0 );
-#endif
- return 1;
- }