]> git.sur5r.net Git - openldap/commitdiff
unifdef -DSLAPD_CONF_UNKNOWN_BAILOUT -DSLAPD_CONF_UNKNOWN_IGNORED=""
authorKurt Zeilenga <kurt@openldap.org>
Tue, 24 Jan 2006 04:40:01 +0000 (04:40 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 24 Jan 2006 04:40:01 +0000 (04:40 +0000)
-DSLAPD_DEBUG_CONFIG_ERROR=LDAP_DEBUG_ANY

servers/slapd/aclparse.c
servers/slapd/back-bdb/attr.c
servers/slapd/back-ldbm/attr.c
servers/slapd/back-ldbm/config.c
servers/slapd/back-meta/config.c
servers/slapd/bconfig.c
servers/slapd/config.c
servers/slapd/overlays/rwmconf.c
servers/slapd/slap.h

index a4b8ed850f1456d1fa1edd3ebc8cb2e1dce5eb6f..567e2b63f37071d511e0c52fc0900a31a022fef7 100644 (file)
@@ -574,21 +574,15 @@ parse_acl(
                                                                        /* FIXME: should be an error */
 
                                                                        snprintf( buf, sizeof( buf ),
-                                                                               "unknown val.<style> \"%s\" "
-                                                                               "for attributeType \"%s\" with DN syntax"
-#ifndef SLAPD_CONF_UNKNOWN_BAILOUT
-                                                                               "; using \"base\""
-#endif /* ! SLAPD_CONF_UNKNOWN_BAILOUT */
-                                                                               SLAPD_CONF_UNKNOWN_IGNORED ".",
+                                                                               "unknown val.<style> \"%s\" for attributeType \"%s\" "
+                                                                                       "with DN syntax.",
                                                                                style,
                                                                                a->acl_attrs[0].an_desc->ad_cname.bv_val );
 
                                                                        Debug( LDAP_DEBUG_CONFIG | LDAP_DEBUG_ACL, 
                                                                                "%s: line %d: %s\n",
                                                                                fname, lineno, buf );
-#ifdef SLAPD_CONF_UNKNOWN_BAILOUT
                                                                        return acl_usage();
-#endif /* SLAPD_CONF_UNKNOWN_BAILOUT */
                                                                        a->acl_attrval_style = ACL_STYLE_BASE;
                                                                }
 
@@ -614,19 +608,12 @@ parse_acl(
                                                                /* FIXME: should be an error */
 
                                                                snprintf( buf, sizeof( buf ),
-                                                                       "unknown val.<style> \"%s\" "
-                                                                       "for attributeType \"%s\""
-#ifndef SLAPD_CONF_UNKNOWN_BAILOUT
-                                                                       "; using \"exact\""
-#endif /* ! SLAPD_CONF_UNKNOWN_BAILOUT */
-                                                                       SLAPD_CONF_UNKNOWN_IGNORED ".",
+                                                                       "unknown val.<style> \"%s\" for attributeType \"%s\".",
                                                                        style, a->acl_attrs[0].an_desc->ad_cname.bv_val );
                                                                Debug( LDAP_DEBUG_CONFIG | LDAP_DEBUG_ACL, 
                                                                        "%s: line %d: %s\n",
                                                                        fname, lineno, buf );
-#ifdef SLAPD_CONF_UNKNOWN_BAILOUT
                                                                return acl_usage();
-#endif /* SLAPD_CONF_UNKNOWN_BAILOUT */
                                                                a->acl_attrval_style = ACL_STYLE_BASE;
                                                        }
                                                }
@@ -827,12 +814,9 @@ parse_acl(
 #ifndef LDAP_PF_LOCAL
                                        Debug( LDAP_DEBUG_CONFIG | LDAP_DEBUG_ACL,
                                                "%s: line %d: "
-                                               "\"path\" style modifier is useless without local"
-                                               SLAPD_CONF_UNKNOWN_IGNORED ".\n",
+                                               "\"path\" style modifier is useless without local.\n",
                                                fname, lineno, 0 );
-#ifdef SLAPD_CONF_UNKNOWN_BAILOUT
                                        return acl_usage();
-#endif /* SLAPD_CONF_UNKNOWN_BAILOUT */
 #endif /* LDAP_PF_LOCAL */
 
                                } else {
@@ -848,13 +832,9 @@ parse_acl(
                                        switch ( sty ) {
                                        case ACL_STYLE_REGEX:
                                                Debug( LDAP_DEBUG_ANY, "%s: line %d: "
-                                                       "\"regex\" style implies "
-                                                       "\"expand\" modifier" 
-                                                       SLAPD_CONF_UNKNOWN_IGNORED ".\n",
+                                                       "\"regex\" style implies \"expand\" modifier.\n",
                                                        fname, lineno, 0 );
-#ifdef SLAPD_CONF_UNKNOWN_BAILOUT
                                                return acl_usage();
-#endif /* SLAPD_CONF_UNKNOWN_BAILOUT */
                                                break;
 
                                        case ACL_STYLE_EXPAND:
@@ -871,15 +851,10 @@ parse_acl(
                                if ( ( sty == ACL_STYLE_EXPAND || expand )
                                                && a->acl_dn_style != ACL_STYLE_REGEX )
                                {
-                                       Debug( LDAP_DEBUG_CONFIG | LDAP_DEBUG_ACL, "%s: line %d: "
-                                               "\"expand\" style or modifier used "
-                                               "in conjunction with "
-                                               "a non-regex <what> clause"
-                                               SLAPD_CONF_UNKNOWN_IGNORED ".\n",
+                                       Debug( LDAP_DEBUG_CONFIG | LDAP_DEBUG_ACL, "%s: line %d: \"expand\" style "
+                                               "or modifier used in conjunction with a non-regex <what> clause.\n",
                                                fname, lineno, 0 );
-#ifdef SLAPD_CONF_UNKNOWN_BAILOUT
                                                return acl_usage();
-#endif /* SLAPD_CONF_UNKNOWN_BAILOUT */
                                }
 
                                if ( strncasecmp( left, "real", STRLENOF( "real" ) ) == 0 ) {
@@ -1021,9 +996,9 @@ parse_acl(
                                                int     gotit = 0;
 
                                                for ( exp = strchr( bdn->a_pat.bv_val, '$' );
-                                                               exp && (ber_len_t)(exp - bdn->a_pat.bv_val)
-                                                                       < bdn->a_pat.bv_len;
-                                                               exp = strchr( exp, '$' ) )
+                                                       exp && (ber_len_t)(exp - bdn->a_pat.bv_val)
+                                                               < bdn->a_pat.bv_len;
+                                                       exp = strchr( exp, '$' ) )
                                                {
                                                        if ( isdigit( exp[ 1 ] ) ) {
                                                                gotit = 1;
@@ -1035,14 +1010,10 @@ parse_acl(
                                                        bdn->a_expand = expand;
 
                                                } else {
-                                                       Debug( LDAP_DEBUG_ANY,
-                                                               "%s: line %d: \"expand\" used "
-                                                               "with no expansions in \"pattern\""
-                                                               SLAPD_CONF_UNKNOWN_IGNORED ".\n",
+                                                       Debug( LDAP_DEBUG_ANY, "%s: line %d: "
+                                                               "\"expand\" used with no expansions in \"pattern\".\n",
                                                                fname, lineno, 0 );
-#ifdef SLAPD_CONF_UNKNOWN_BAILOUT
                                                        return acl_usage();
-#endif /* SLAPD_CONF_UNKNOWN_BAILOUT */
                                                } 
                                        }
                                        if ( sty == ACL_STYLE_SELF ) {
@@ -1909,13 +1880,9 @@ parse_acl(
        /* if we have no real access clause, complain and do nothing */
        if ( a == NULL ) {
                Debug( LDAP_DEBUG_ANY, "%s: line %d: "
-                       "warning: no access clause(s) "
-                       "specified in access line"
-                       SLAPD_CONF_UNKNOWN_IGNORED ".\n",
+                       "warning: no access clause(s) specified in access line.\n",
                        fname, lineno, 0 );
-#ifdef SLAPD_CONF_UNKNOWN_BAILOUT
                return acl_usage();
-#endif /* SLAPD_CONF_UNKNOWN_BAILOUT */
 
        } else {
 #ifdef LDAP_DEBUG
@@ -1926,13 +1893,9 @@ parse_acl(
        
                if ( a->acl_access == NULL ) {
                        Debug( LDAP_DEBUG_ANY, "%s: line %d: "
-                               "warning: no by clause(s) "
-                               "specified in access line"
-                               SLAPD_CONF_UNKNOWN_IGNORED ".\n",
+                               "warning: no by clause(s) specified in access line.\n",
                                fname, lineno, 0 );
-#ifdef SLAPD_CONF_UNKNOWN_BAILOUT
                        return acl_usage();
-#endif /* SLAPD_CONF_UNKNOWN_BAILOUT */
                }
 
                if ( be != NULL ) {
index 8a728656d55c9b4f878ecebdd26aa649f16fb7da..a98dbb7558f28d1e62478450762f0f78fc691a5f 100644 (file)
@@ -285,8 +285,8 @@ bdb_attr_index_config(
                                ch_free( a );
                                continue;
                        }
-                       fprintf( stderr, "%s: line %d: duplicate index definition "
-                               "for attr \"%s\"" SLAPD_CONF_UNKNOWN_IGNORED ".\n",
+                       fprintf( stderr,
+                               "%s: line %d: duplicate index definition for attr \"%s\".\n",
                                fname, lineno, attrs[i] );
 
                        return LDAP_PARAM_ERROR;
index b5d41639c3c6f547bae632412378003472856db8..51bcb2f2871b92b573415ebfdd3fade8d6b718df 100644 (file)
@@ -200,8 +200,8 @@ attr_index_config(
                                 ainfo_cmp, avl_dup_error );
 
                if( rc ) {
-                       fprintf( stderr, "%s: line %d: duplicate index definition "
-                               "for attr \"%s\"" SLAPD_CONF_UNKNOWN_IGNORED ".\n",
+                       fprintf( stderr,
+                               "%s: line %d: duplicate index definition for attr \"%s\".\n",
                            fname, lineno, attrs[i] );
 
                        return LDAP_PARAM_ERROR;
index 7918edf717928bdab409f684279e0b180ac9ac8e..dc8ea7cab5bf31535d8da7c1c283a0d054a0d714 100644 (file)
@@ -78,12 +78,10 @@ ldbm_back_db_config(
                            fname, lineno );
                        return( 1 );
                } else if ( argc > 3 ) {
-                       fprintf( stderr,
-"%s: line %d: extra junk after \"index <attr> [pres,eq,approx,sub]\" line" SLAPD_CONF_UNKNOWN_IGNORED ".\n",
+                       fprintf( stderr, "%s: line %d: extra junk "
+                               "after \"index <attr> [pres,eq,approx,sub]\" line.\n",
                            fname, lineno );
-#ifdef SLAPD_CONF_UNKNOWN_BAILOUT
                        return( 1 );
-#endif /* SLAPD_CONF_UNKNOWN_BAILOUT */
                }
                rc = attr_index_config( li, fname, lineno, argc - 1, &argv[1] );
 
index 30ddd8d0e6521d9ad4c192b1874d4afda07e7225..77b47f8bb9d96751e4a8cc80653af3e73318b751 100644 (file)
@@ -1126,7 +1126,7 @@ ldap_back_map_config(
                        || avl_find( map->remap, (caddr_t)&mapping[ 1 ], mapping_cmp ) != NULL)
        {
                Debug( LDAP_DEBUG_ANY,
-                       "%s: line %d: duplicate mapping found" SLAPD_CONF_UNKNOWN_IGNORED ".\n",
+                       "%s: line %d: duplicate mapping found.\n",
                        fname, lineno, 0 );
                goto error_return;
        }
index 39c8af54bd09929c603f54d2b3a691ad34377975..3d3771b838df86ebf92e2d0e77fb966ebf888561 100644 (file)
@@ -1450,13 +1450,10 @@ config_generic(ConfigArgs *c) {
 
 
                default:
-                       Debug( SLAPD_DEBUG_CONFIG_ERROR,
-                               "%s: unknown CFG_TYPE %d"
-                               SLAPD_CONF_UNKNOWN_IGNORED ".\n",
+                       Debug( LDAP_DEBUG_ANY,
+                               "%s: unknown CFG_TYPE %d.\n",
                                c->log, c->type, 0 );
-#ifdef SLAPD_CONF_UNKNOWN_BAILOUT
                        return 1;
-#endif /* SLAPD_CONF_UNKNOWN_BAILOUT */
 
        }
        return(0);
@@ -1701,12 +1698,10 @@ config_overlay(ConfigArgs *c) {
        }
        if(c->argv[1][0] == '-' && overlay_config(c->be, &c->argv[1][1])) {
                /* log error */
-               Debug( SLAPD_DEBUG_CONFIG_ERROR, "%s: (optional) %s overlay \"%s\" configuration failed"
-                       SLAPD_CONF_UNKNOWN_IGNORED ".\n",
+               Debug( LDAP_DEBUG_ANY,
+                       "%s: (optional) %s overlay \"%s\" configuration failed.\n",
                        c->log, c->be == frontendDB ? "global " : "", &c->argv[1][1]);
-#ifdef SLAPD_CONF_UNKNOWN_BAILOUT
                return 1;
-#endif /* SLAPD_CONF_UNKNOWN_BAILOUT */
        } else if(overlay_config(c->be, c->argv[1])) {
                return(1);
        }
@@ -1848,13 +1843,9 @@ config_suffix(ConfigArgs *c)
        ndn = c->value_ndn;
        tbe = select_backend(&ndn, 0, 0);
        if(tbe == c->be) {
-               Debug( SLAPD_DEBUG_CONFIG_ERROR,
-                       "%s: suffix already served by this backend!"
-                       SLAPD_CONF_UNKNOWN_IGNORED ".\n",
+               Debug( LDAP_DEBUG_ANY, "%s: suffix already served by this backend!.\n",
                        c->log, 0, 0);
-#ifdef SLAPD_CONF_UNKNOWN_BAILOUT
                return 1;
-#endif /* SLAPD_CONF_UNKNOWN_BAILOUT */
                free(pdn.bv_val);
                free(ndn.bv_val);
        } else if(tbe) {
@@ -2576,22 +2567,16 @@ config_replica(ConfigArgs *c) {
                        } else if(!strncasecmp(c->argv[i], "suffix=", STRLENOF( "suffix="))) {
                                switch(add_replica_suffix(c->be, nr, c->argv[i] + STRLENOF("suffix="))) {
                                        case 1:
-                                               Debug( SLAPD_DEBUG_CONFIG_ERROR, "%s: "
-                                               "suffix \"%s\" in \"replica\" line is not valid for backend"
-                                               SLAPD_CONF_UNKNOWN_IGNORED ".\n",
-                                               c->log, c->argv[i] + STRLENOF("suffix="), 0);
-#ifdef SLAPD_CONF_UNKNOWN_BAILOUT
+                                               Debug( LDAP_DEBUG_ANY, "%s: "
+                                                       "suffix \"%s\" in \"replica\" line is not valid for backend.\n",
+                                                       c->log, c->argv[i] + STRLENOF("suffix="), 0);
                                                return 1;
-#endif /* SLAPD_CONF_UNKNOWN_BAILOUT */
                                                break;
                                        case 2:
-                                               Debug( SLAPD_DEBUG_CONFIG_ERROR, "%s: "
-                                               "unable to normalize suffix in \"replica\" line"
-                                               SLAPD_CONF_UNKNOWN_IGNORED ".\n",
-                                               c->log, 0, 0);
-#ifdef SLAPD_CONF_UNKNOWN_BAILOUT
+                                               Debug( LDAP_DEBUG_ANY, "%s: "
+                                                       "unable to normalize suffix in \"replica\" line.\n",
+                                                       c->log, 0, 0);
                                                return 1;
-#endif /* SLAPD_CONF_UNKNOWN_BAILOUT */
                                                break;
                                }
 
index 649be367e77b29839880bb4c93d0854fae406546..2c44708bfa93f235f2862e2b8c6e1c2202bc49ca 100644 (file)
@@ -735,15 +735,10 @@ read_config_file(const char *fname, int depth, ConfigArgs *cf, ConfigTable *cft)
                }
 
                if ( c->argc < 1 ) {
-                       Debug( SLAPD_DEBUG_CONFIG_ERROR, "%s: bad config line" 
-                               SLAPD_CONF_UNKNOWN_IGNORED ".\n",
+                       Debug( LDAP_DEBUG_ANY, "%s: bad config line.\n",
                                c->log, 0, 0);
-#ifdef SLAPD_CONF_UNKNOWN_BAILOUT
                        rc = 1;
                        goto done;
-#else /* ! SLAPD_CONF_UNKNOWN_BAILOUT */
-                       continue;
-#endif /* ! SLAPD_CONF_UNKNOWN_BAILOUT */
                }
 
                c->op = SLAP_CONFIG_ADD;
@@ -780,13 +775,9 @@ read_config_file(const char *fname, int depth, ConfigArgs *cf, ConfigTable *cft)
                        if ( rc ) {
                                switch(rc) {
                                case SLAP_CONF_UNKNOWN:
-                                       Debug( SLAPD_DEBUG_CONFIG_ERROR, "%s: "
-                                               "unknown directive <%s> inside backend info definition"
-                                               SLAPD_CONF_UNKNOWN_IGNORED ".\n",
+                                       Debug( LDAP_DEBUG_ANY, "%s: unknown directive "
+                                               "<%s> inside backend info definition.\n",
                                                c->log, *c->argv, 0);
-#ifndef SLAPD_CONF_UNKNOWN_BAILOUT
-                                       continue;
-#endif /* ! SLAPD_CONF_UNKNOWN_BAILOUT */
                                default:
                                        rc = 1;
                                        goto done;
@@ -805,11 +796,13 @@ read_config_file(const char *fname, int depth, ConfigArgs *cf, ConfigTable *cft)
                                rc = (*c->be->be_config)(c->be, c->fname, c->lineno,
                                        c->argc, c->argv);
                        }
-                       if ( rc == SLAP_CONF_UNKNOWN && SLAP_ISGLOBALOVERLAY( frontendDB ) ) {
+                       if ( rc == SLAP_CONF_UNKNOWN && SLAP_ISGLOBALOVERLAY( frontendDB ) )
+                       {
                                /* global overlays may need 
                                 * definitions inside other databases...
                                 */
-                               rc = (*frontendDB->be_config)(frontendDB, c->fname, (int)c->lineno, c->argc, c->argv);
+                               rc = (*frontendDB->be_config)( frontendDB,
+                                       c->fname, (int)c->lineno, c->argc, c->argv );
                        }
 
                        switch ( rc ) {
@@ -817,13 +810,9 @@ read_config_file(const char *fname, int depth, ConfigArgs *cf, ConfigTable *cft)
                                break;
 
                        case SLAP_CONF_UNKNOWN:
-                               Debug( SLAPD_DEBUG_CONFIG_ERROR, "%s: "
-                                       "unknown directive <%s> inside backend database "
-                                       "definition" SLAPD_CONF_UNKNOWN_IGNORED ".\n",
+                               Debug( LDAP_DEBUG_ANY, "%s: unknown directive "
+                                       "<%s> inside backend database definition.\n",
                                        c->log, *c->argv, 0);
-#ifndef SLAPD_CONF_UNKNOWN_BAILOUT
-                               break;
-#endif /* ! SLAPD_CONF_UNKNOWN_BAILOUT */
                                
                        default:
                                rc = 1;
@@ -831,17 +820,14 @@ read_config_file(const char *fname, int depth, ConfigArgs *cf, ConfigTable *cft)
                        }
 
                } else if ( frontendDB->be_config ) {
-                       rc = (*frontendDB->be_config)(frontendDB, c->fname, (int)c->lineno, c->argc, c->argv);
+                       rc = (*frontendDB->be_config)( frontendDB,
+                               c->fname, (int)c->lineno, c->argc, c->argv);
                        if ( rc ) {
                                switch(rc) {
                                case SLAP_CONF_UNKNOWN:
-                                       Debug( SLAPD_DEBUG_CONFIG_ERROR, "%s: "
-                                               "unknown directive <%s> inside global database definition"
-                                               SLAPD_CONF_UNKNOWN_IGNORED ".\n",
+                                       Debug( LDAP_DEBUG_ANY, "%s: unknown directive "
+                                               "<%s> inside global database definition.\n",
                                                c->log, *c->argv, 0);
-#ifndef SLAPD_CONF_UNKNOWN_BAILOUT
-                                       break;
-#endif /* ! SLAPD_CONF_UNKNOWN_BAILOUT */
 
                                default:
                                        rc = 1;
@@ -850,16 +836,11 @@ read_config_file(const char *fname, int depth, ConfigArgs *cf, ConfigTable *cft)
                        }
                        
                } else {
-                       Debug( SLAPD_DEBUG_CONFIG_ERROR, "%s: "
-                               "unknown directive <%s> outside backend info and database definitions"
-                               SLAPD_CONF_UNKNOWN_IGNORED ".\n",
+                       Debug( LDAP_DEBUG_ANY, "%s: unknown directive "
+                               "<%s> outside backend info and database definitions.\n",
                                c->log, *c->argv, 0);
-#ifdef SLAPD_CONF_UNKNOWN_BAILOUT
                        rc = 1;
                        goto done;
-#else /* ! SLAPD_CONF_UNKNOWN_BAILOUT */
-                       continue;
-#endif /* ! SLAPD_CONF_UNKNOWN_BAILOUT */
                }
        }
 
@@ -878,9 +859,9 @@ done:
 int
 verb_to_mask(const char *word, slap_verbmasks *v) {
        int i;
-       for(i = 0; !BER_BVISNULL(&v[i].word); i++)
-               if(!strcasecmp(word, v[i].word.bv_val))
-                       break;
+       for(i = 0; !BER_BVISNULL(&v[i].word); i++) {
+               if(!strcasecmp(word, v[i].word.bv_val)) break;
+       }
        return(i);
 }
 
@@ -924,8 +905,7 @@ slap_verbmasks_init( slap_verbmasks **vp, slap_verbmasks *v )
 
        assert( *vp == NULL );
 
-       for ( i = 0; !BER_BVISNULL( &v[ i ].word ); i++ )
-               ;
+       for ( i = 0; !BER_BVISNULL( &v[ i ].word ); i++ ) /* EMPTY */;
 
        *vp = ch_calloc( i + 1, sizeof( slap_verbmasks ) );
 
index 6aef81051c666013cf2a7daae45047eb55e50ccb..e02ccb5ae7bf1e9d35cb1719784335c36fa7c335 100644 (file)
@@ -217,7 +217,7 @@ rwm_map_config(
                        || avl_find( map->remap, (caddr_t)&mapping[1], rwm_mapping_cmp ) != NULL)
        {
                fprintf( stderr,
-                       "%s: line %d: duplicate mapping found" SLAPD_CONF_UNKNOWN_IGNORED ".\n",
+                       "%s: line %d: duplicate mapping found.\n",
                        fname, lineno );
                /* FIXME: free stuff */
                goto error_return;
index 9004133dee304198afe827f7ee71d6cb175ae410..5c84c13db4910eac992a0cbd0088c0acc784c05c 100644 (file)
@@ -72,7 +72,6 @@ LDAP_BEGIN_DECL
 #define LDAP_DYNAMIC_OBJECTS
 #define LDAP_SYNC_TIMESTAMP
 #define LDAP_COLLECTIVE_ATTRIBUTES
-#define SLAPD_CONF_UNKNOWN_BAILOUT
 #define SLAP_CONTROL_X_TREE_DELETE LDAP_CONTROL_X_TREE_DELETE
 
 #define SLAP_ORDERED_PRETTYNORM
@@ -87,17 +86,6 @@ LDAP_BEGIN_DECL
 #define SLAP_OVERLAY_ACCESS
 #endif
 
-/*
- * ITS#3705: bail out if unknown config directives appear in slapd.conf
- */
-#ifdef SLAPD_CONF_UNKNOWN_BAILOUT
-#define        SLAPD_CONF_UNKNOWN_IGNORED      ""
-#define SLAPD_DEBUG_CONFIG_ERROR       LDAP_DEBUG_ANY
-#else /* ! SLAPD_CONF_UNKNOWN_BAILOUT */
-#define        SLAPD_CONF_UNKNOWN_IGNORED      " (ignored)"
-#define SLAPD_DEBUG_CONFIG_ERROR       LDAP_DEBUG_CONFIG
-#endif /* ! SLAPD_CONF_UNKNOWN_BAILOUT */
-
 /*
  * SLAPD Memory allocation macros
  *