From 17d920063a547b814e6fc5b6d18144ac0f378865 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Wed, 1 Sep 2004 00:34:34 +0000 Subject: [PATCH] subsequent allows/disallows directives should be additive --- servers/slapd/config.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/servers/slapd/config.c b/servers/slapd/config.c index b9a3e89553..5262ff8d18 100644 --- a/servers/slapd/config.c +++ b/servers/slapd/config.c @@ -1480,7 +1480,7 @@ restrict_unknown:; } else if( strcasecmp( cargv[i], "update_anon" ) == 0 ) { allows |= SLAP_ALLOW_UPDATE_ANON; - } else if( strcasecmp( cargv[i], "none" ) != 0 ) { + } else { #ifdef NEW_LOGGING LDAP_LOG( CONFIG, CRIT, "%s: line %d: " "unknown feature %s in \"allow \" line.\n", @@ -1491,17 +1491,17 @@ restrict_unknown:; fname, lineno, cargv[i] ); #endif - return( 1 ); + return 1; } } - global_allows = allows; + global_allows |= allows; /* disallow these features */ } else if ( strcasecmp( cargv[0], "disallows" ) == 0 || strcasecmp( cargv[0], "disallow" ) == 0 ) { - slap_mask_t disallows; + slap_mask_t disallows = 0; if ( be != NULL ) { #ifdef NEW_LOGGING @@ -1530,8 +1530,6 @@ restrict_unknown:; return( 1 ); } - disallows = 0; - for( i=1; i < cargc; i++ ) { if( strcasecmp( cargv[i], "bind_anon" ) == 0 ) { disallows |= SLAP_DISALLOW_BIND_ANON; @@ -1548,7 +1546,7 @@ restrict_unknown:; } else if( strcasecmp( cargv[i], "tls_authc" ) == 0 ) { disallows |= SLAP_DISALLOW_TLS_AUTHC; - } else if( strcasecmp( cargv[i], "none" ) != 0 ) { + } else { #ifdef NEW_LOGGING LDAP_LOG( CONFIG, CRIT, "%s: line %d: unknown feature %s in " @@ -1560,17 +1558,17 @@ restrict_unknown:; fname, lineno, cargv[i] ); #endif - return( 1 ); + return 1; } } - global_disallows = disallows; + global_disallows |= disallows; /* require these features */ } else if ( strcasecmp( cargv[0], "requires" ) == 0 || strcasecmp( cargv[0], "require" ) == 0 ) { - slap_mask_t requires; + slap_mask_t requires = 0; if ( cargc < 2 ) { #ifdef NEW_LOGGING @@ -1586,8 +1584,6 @@ restrict_unknown:; return( 1 ); } - requires = 0; - for( i=1; i < cargc; i++ ) { if( strcasecmp( cargv[i], "bind" ) == 0 ) { requires |= SLAP_REQUIRE_BIND; -- 2.39.5