mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
cleanup version parsing
This commit is contained in:
parent
2110880be1
commit
470fda7744
@ -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:
|
||||
|
@ -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 ] );
|
||||
|
Loading…
Reference in New Issue
Block a user