Leave only LDAPv2+ and LDAPv3.
/* general stuff */
#define LDAP_TAG_MESSAGE (ber_tag_t) 0x30U /* constructed + 16 */
-#define OLD_LDAP_TAG_MESSAGE (ber_tag_t) 0x10U /* forgot the constructed bit */
#define LDAP_TAG_MSGID (ber_tag_t) 0x02U /* integer */
#define LDAP_TAG_LDAPDN (ber_tag_t) 0x04U /* octect string */
#define LDAP_TAG_CONTROLS (ber_tag_t) 0xa0U /* context specific + constructed + 0 */
#define LDAP_REQ_ABANDON (ber_tag_t) 0x50U /* application + primitive */
#define LDAP_REQ_EXTENDED (ber_tag_t) 0x77U /* application + constructed */
-/* U-Mich version 3.0 compatibility stuff */
-#define LDAP_REQ_UNBIND_30 (ber_tag_t) 0x62U
-#define LDAP_REQ_DELETE_30 (ber_tag_t) 0x6aU
-#define LDAP_REQ_ABANDON_30 (ber_tag_t) 0x70U
-
-/*
- * old broken stuff for backwards compatibility - forgot application tag
- * and constructed/primitive bit
- */
-#define OLD_LDAP_REQ_BIND (ber_tag_t) 0x00U
-#define OLD_LDAP_REQ_UNBIND (ber_tag_t) 0x02U
-#define OLD_LDAP_REQ_SEARCH (ber_tag_t) 0x03U
-#define OLD_LDAP_REQ_MODIFY (ber_tag_t) 0x06U
-#define OLD_LDAP_REQ_ADD (ber_tag_t) 0x08U
-#define OLD_LDAP_REQ_DELETE (ber_tag_t) 0x0aU
-#define OLD_LDAP_REQ_MODRDN (ber_tag_t) 0x0cU
-#define OLD_LDAP_REQ_COMPARE (ber_tag_t) 0x0eU
-#define OLD_LDAP_REQ_ABANDON (ber_tag_t) 0x10U
-
/* possible result types a server can return */
#define LDAP_RES_BIND (ber_tag_t) 0x61U /* application + constructed */
#define LDAP_RES_SEARCH_ENTRY (ber_tag_t) 0x64U /* application + constructed */
#define LDAP_RES_EXTENDED (ber_tag_t) 0x78U /* V3: application + constructed */
#define LDAP_RES_ANY ((ber_tag_t)(~0))
-/* old broken stuff for backwards compatibility */
-#define OLD_LDAP_RES_BIND (ber_tag_t) 0x01UL
-#define OLD_LDAP_RES_SEARCH_ENTRY (ber_tag_t) 0x04UL
-#define OLD_LDAP_RES_SEARCH_RESULT (ber_tag_t) 0x05U
-#define OLD_LDAP_RES_MODIFY (ber_tag_t) 0x07U
-#define OLD_LDAP_RES_ADD (ber_tag_t) 0x09U
-#define OLD_LDAP_RES_DELETE (ber_tag_t) 0x0bU
-#define OLD_LDAP_RES_MODRDN (ber_tag_t) 0x0dU
-#define OLD_LDAP_RES_MODDN OLD_LDAP_RES_MODRDN
-#define OLD_LDAP_RES_COMPARE (ber_tag_t) 0x0fU
/* sasl methods */
#define LDAP_SASL_SIMPLE NULL
#define LDAP_AUTH_KRBV41 (ber_tag_t) 0x81U /* context specific + primitive */
#define LDAP_AUTH_KRBV42 (ber_tag_t) 0x82U /* context specific + primitive */
-/* U-Mich version 3.0 compatibility auth methods */
-#define LDAP_AUTH_SIMPLE_30 (ber_tag_t) 0xa0U /* context specific + constructed */
-#define LDAP_AUTH_KRBV41_30 (ber_tag_t) 0xa1U /* context specific + constructed */
-#define LDAP_AUTH_KRBV42_30 (ber_tag_t) 0xa2U /* context specific + constructed */
-
-/* old broken stuff */
-#define OLD_LDAP_AUTH_SIMPLE (ber_tag_t) 0x00U
-#define OLD_LDAP_AUTH_KRBV4 (ber_tag_t) 0x01U
-#define OLD_LDAP_AUTH_KRBV42 (ber_tag_t) 0x02U
/* filter types */
#define LDAP_FILTER_AND (ber_tag_t) 0xa0U /* context specific + constructed */
#define LDAP_FILTER_APPROX (ber_tag_t) 0xa8U /* context specific + constructed */
#define LDAP_FILTER_EXTENDED (ber_tag_t) 0xa9U /* context specific + constructed */
-/* U-Mich version 3.0 compatibility filter types */
-#define LDAP_FILTER_PRESENT_30 (ber_tag_t) 0xa7U /* context specific + constructed */
-
-/* old broken stuff */
-#define OLD_LDAP_FILTER_AND (ber_tag_t) 0x00U
-#define OLD_LDAP_FILTER_OR (ber_tag_t) 0x01U
-#define OLD_LDAP_FILTER_NOT (ber_tag_t) 0x02U
-#define OLD_LDAP_FILTER_EQUALITY (ber_tag_t) 0x03U
-#define OLD_LDAP_FILTER_SUBSTRINGS (ber_tag_t) 0x04U
-#define OLD_LDAP_FILTER_GE (ber_tag_t) 0x05U
-#define OLD_LDAP_FILTER_LE (ber_tag_t) 0x06U
-#define OLD_LDAP_FILTER_PRESENT (ber_tag_t) 0x07U
-#define OLD_LDAP_FILTER_APPROX (ber_tag_t) 0x08U
-
/* extended filter component types */
#define LDAP_FILTER_EXTENDED_OID (ber_tag_t) 0x81U /* context specific */
#define LDAP_FILTER_EXTENDED_TYPE (ber_tag_t) 0x82U /* context specific */
#define LDAP_SUBSTRING_ANY (ber_tag_t) 0x81U /* context specific */
#define LDAP_SUBSTRING_FINAL (ber_tag_t) 0x82U /* context specific */
-/* U-Mich version 3.0 compatibility substring filter component types */
-#define LDAP_SUBSTRING_INITIAL_30 (ber_tag_t) 0xa0U /* context specific */
-#define LDAP_SUBSTRING_ANY_30 (ber_tag_t) 0xa1U /* context specific */
-#define LDAP_SUBSTRING_FINAL_30 (ber_tag_t) 0xa2U /* context specific */
-
-/* old broken stuff */
-#define OLD_LDAP_SUBSTRING_INITIAL (ber_tag_t) 0x00U
-#define OLD_LDAP_SUBSTRING_ANY (ber_tag_t) 0x01U
-#define OLD_LDAP_SUBSTRING_FINAL (ber_tag_t) 0x02U
-
/* search scopes */
#define LDAP_SCOPE_BASE (ber_int_t) 0x0000
#define LDAP_SCOPE_ONELEVEL (ber_int_t) 0x0001
* }
*/
-#ifdef LDAP_COMPAT30
- /*
- * in version 3.0 there is an extra SEQUENCE tag after the
- * BindRequest SEQUENCE tag.
- */
-
- {
- BerElement *tber;
- ber_len_t tlen;
- ber_tag_t ttag;
-
- tber = ber_dup( op->o_ber );
- ttag = ber_skip_tag( tber, &tlen );
- if ( ber_peek_tag( tber, &tlen ) == LBER_SEQUENCE ) {
- Debug( LDAP_DEBUG_ANY, "bind: u-mich v3.0 detected\n", 0, 0, 0 );
- conn->c_version = 30;
- rc = ber_scanf(ber, "{{iato}}", &version, &cdn, &method, &cred);
- } else {
- rc = ber_scanf( ber, "{iato}", &version, &cdn, &method, &cred );
- }
-
- ber_free( tber, 0 );
- }
-#else
rc = ber_scanf( ber, "{iato}", &version, &cdn, &method, &cred );
-#endif
if ( rc == LBER_ERROR ) {
Debug( LDAP_DEBUG_ANY, "bind: ber_scanf failed\n", 0, 0, 0 );
return;
}
-#ifdef LDAP_COMPAT30
- if ( conn->c_version == 30 ) {
- switch ( method ) {
- case LDAP_AUTH_SIMPLE_30:
- method = LDAP_AUTH_SIMPLE;
- break;
-#ifdef HAVE_KERBEROS
- case LDAP_AUTH_KRBV41_30:
- method = LDAP_AUTH_KRBV41;
- break;
- case LDAP_AUTH_KRBV42_30:
- method = LDAP_AUTH_KRBV42;
- break;
-#endif
- }
- }
-#endif /* compat30 */
-
Debug( LDAP_DEBUG_TRACE, "do_bind: version %d dn (%s) method %d\n",
version, cdn, method );
backend_connection_destroy(c);
-#ifdef LDAP_COMPAT30
- c->c_version = 0;
-#endif
c->c_protocol = 0;
c->c_activitytime = c->c_starttime = 0;
do_bind( conn, arg->co_op );
break;
-#ifdef LDAP_COMPAT30
- case LDAP_REQ_UNBIND_30:
-#endif
case LDAP_REQ_UNBIND:
do_unbind( conn, arg->co_op );
break;
do_add( conn, arg->co_op );
break;
-#ifdef LDAP_COMPAT30
- case LDAP_REQ_DELETE_30:
-#endif
case LDAP_REQ_DELETE:
do_delete( conn, arg->co_op );
break;
do_search( conn, arg->co_op );
break;
-#ifdef LDAP_COMPAT30
- case LDAP_REQ_ABANDON_30:
-#endif
case LDAP_REQ_ABANDON:
do_abandon( conn, arg->co_op );
break;
arg = NULL;
switch( tag ) {
-#ifdef LDAP_COMPAT30
- case LDAP_REQ_UNBIND_30:
-#endif
case LDAP_REQ_UNBIND:
/* c_mutex is locked */
connection_closing( conn );
return -1;
}
-#ifdef LDAP_COMPAT30
- if ( conn->c_version == 30 ) {
- (void) ber_skip_tag( ber, &len );
- }
-#endif
-
op = slap_op_alloc( ber, msgid, tag, conn->c_n_ops_received++ );
if ( conn->c_conn_state == SLAP_C_BINDING
err = 0;
*fstr = NULL;
f->f_choice = ber_peek_tag( ber, &len );
-#ifdef LDAP_COMPAT30
- if ( conn->c_version == 30 ) {
- switch ( f->f_choice ) {
- case LDAP_FILTER_EQUALITY:
- case LDAP_FILTER_GE:
- case LDAP_FILTER_LE:
- case LDAP_FILTER_PRESENT:
- case LDAP_FILTER_PRESENT_30:
- case LDAP_FILTER_APPROX:
- (void) ber_skip_tag( ber, &len );
- if ( f->f_choice == LDAP_FILTER_PRESENT_30 ) {
- f->f_choice = LDAP_FILTER_PRESENT;
- }
- break;
- default:
- break;
- }
- }
-#endif
+
switch ( f->f_choice ) {
case LDAP_FILTER_EQUALITY:
Debug( LDAP_DEBUG_FILTER, "EQUALITY\n", 0, 0, 0 );
Debug( LDAP_DEBUG_FILTER, "begin get_filter_list\n", 0, 0, 0 );
-#ifdef LDAP_COMPAT30
- if ( conn->c_version == 30 ) {
- (void) ber_skip_tag( ber, &len );
- }
-#endif
*fstr = NULL;
new = f;
for ( tag = ber_first_element( ber, &len, &last ); tag != LBER_DEFAULT;
Debug( LDAP_DEBUG_FILTER, "begin get_substring_filter\n", 0, 0, 0 );
-#ifdef LDAP_COMPAT30
- if ( conn->c_version == 30 ) {
- (void) ber_skip_tag( ber, &len );
- }
-#endif
if ( ber_scanf( ber, "{a" /*}*/, &f->f_sub_type ) == LBER_ERROR ) {
return( LDAP_PROTOCOL_ERROR );
}
sprintf( *fstr, "(%s=", f->f_sub_type );
for ( tag = ber_first_element( ber, &len, &last ); tag != LBER_DEFAULT;
tag = ber_next_element( ber, &len, last ) ) {
-#ifdef LDAP_COMPAT30
- if ( conn->c_version == 30 ) {
- rc = ber_scanf( ber, "{a}", &val );
- } else
-#endif
rc = ber_scanf( ber, "a", &val );
if ( rc == LBER_ERROR ) {
return( LDAP_PROTOCOL_ERROR );
value_normalize( val, syntax );
switch ( tag ) {
-#ifdef LDAP_COMPAT30
- case LDAP_SUBSTRING_INITIAL_30:
-#endif
case LDAP_SUBSTRING_INITIAL:
Debug( LDAP_DEBUG_FILTER, " INITIAL\n", 0, 0, 0 );
if ( f->f_sub_initial != NULL ) {
strcat( *fstr, val );
break;
-#ifdef LDAP_COMPAT30
- case LDAP_SUBSTRING_ANY_30:
-#endif
case LDAP_SUBSTRING_ANY:
Debug( LDAP_DEBUG_FILTER, " ANY\n", 0, 0, 0 );
charray_add( &f->f_sub_any, val );
strcat( *fstr, val );
break;
-#ifdef LDAP_COMPAT30
- case LDAP_SUBSTRING_FINAL_30:
-#endif
case LDAP_SUBSTRING_FINAL:
Debug( LDAP_DEBUG_FILTER, " FINAL\n", 0, 0, 0 );
if ( f->f_sub_final != NULL ) {
}
-#ifdef LDAP_COMPAT30
- ber = ber_alloc_t( conn->c_version == 30 ? 0 : LBER_USE_DER );
-#else
- ber = der_alloc();
-#endif
+ ber = ber_alloc_t( LBER_USE_DER );
+
if ( ber == NULL ) {
Debug( LDAP_DEBUG_ANY, "ber_alloc failed\n", 0, 0, 0 );
return;
err, matched ? matched : "", text ? text : "" );
} else
#endif
-#ifdef LDAP_COMPAT30
- if ( conn->c_version == 30 ) {
- rc = ber_printf( ber, "{it{{ess}}}", op->o_msgid, tag, err,
- matched ? matched : "", text ? text : "" );
- } else
-#endif
+ {
rc = ber_printf( ber, "{it{ess}}", op->o_msgid, tag, err,
matched ? matched : "", text ? text : "" );
+ }
if ( rc == -1 ) {
Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
edn = e->e_ndn;
-#ifdef LDAP_COMPAT30
- ber = ber_alloc_t( conn->c_version == 30 ? 0 : LBER_USE_DER );
-#else
- ber = der_alloc();
-#endif
+ ber = ber_alloc_t( LBER_USE_DER );
if ( ber == NULL ) {
Debug( LDAP_DEBUG_ANY, "ber_alloc failed\n", 0, 0, 0 );
goto error_return;
}
-#ifdef LDAP_COMPAT30
- if ( conn->c_version == 30 ) {
- rc = ber_printf( ber, "{it{{s{", op->o_msgid,
- LDAP_RES_SEARCH_ENTRY, e->e_dn );
- } else
-#endif
- {
- rc = ber_printf( ber, "{it{s{", op->o_msgid,
- LDAP_RES_SEARCH_ENTRY, e->e_dn );
- }
+ rc = ber_printf( ber, "{it{s{", op->o_msgid,
+ LDAP_RES_SEARCH_ENTRY, e->e_dn );
if ( rc == -1 ) {
Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
}
}
-#ifdef LDAP_COMPAT30
- if ( conn->c_version == 30 ) {
- rc = ber_printf( ber, /*{{{{{*/ "}}}}" );
- } else
-#endif
- rc = ber_printf( ber, /*{{{{*/ "}}}" );
+ rc = ber_printf( ber, /*{{{*/ "}}}" );
if ( rc == -1 ) {
Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
ber_int_t c_protocol; /* version of the LDAP protocol used by client */
ber_tag_t c_authtype; /* auth method used to bind c_dn */
-#ifdef LDAP_COMPAT
- int c_version; /* for compatibility w/ U-Mich 2.0 & 3.0 */
-#endif
-
Operation *c_ops; /* list of operations being processed */
Operation *c_pending_ops; /* list of pending operations */