cleanup version parsing

This commit is contained in:
Pierangelo Masarati 2006-05-06 10:42:29 +00:00
parent 2110880be1
commit 470fda7744
2 changed files with 9 additions and 15 deletions

View File

@ -1323,16 +1323,16 @@ done_url:;
} break;
case LDAP_BACK_CFG_VERSION:
switch ( c->value_int ) {
case 0:
case LDAP_VERSION2:
case LDAP_VERSION3:
li->li_version = c->value_int;
break;
default:
if ( c->value_int != 0 && ( c->value_int < LDAP_VERSION_MIN || c->value_int > LDAP_VERSION_MAX ) ) {
snprintf( c->msg, sizeof( c->msg ),
"unsupported version \"%s\" "
"in \"protocol-version <version>\"",
c->argv[ 1 ] );
Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 );
return 1;
}
li->li_version = c->value_int;
break;
case LDAP_BACK_CFG_REWRITE:

View File

@ -1069,13 +1069,7 @@ meta_back_db_config(
return 1;
}
switch ( *version ) {
case 0:
case LDAP_VERSION2:
case LDAP_VERSION3:
break;
default:
if ( *version != 0 && ( *version < LDAP_VERSION_MIN || *version > LDAP_VERSION_MAX ) ) {
Debug( LDAP_DEBUG_ANY,
"%s: line %d: unsupported version \"%s\" in \"protocol-version <version>\"\n",
fname, lineno, argv[ 1 ] );