From 2660d0b42f6467dcd9043bd4666110e7f3d4b218 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Tue, 29 Jun 1999 00:03:34 +0000 Subject: [PATCH] Remove old U-Mich v3.0 and OLD_LDAP_* crud. Leave only LDAPv2+ and LDAPv3. --- include/ldap.h | 63 -------------------------------------- servers/slapd/bind.c | 43 -------------------------- servers/slapd/connection.c | 21 ------------- servers/slapd/filter.c | 44 +------------------------- servers/slapd/result.c | 40 +++++------------------- servers/slapd/slap.h | 4 --- 6 files changed, 9 insertions(+), 206 deletions(-) diff --git a/include/ldap.h b/include/ldap.h index e35b7fb1e6..79e9a8ba77 100644 --- a/include/ldap.h +++ b/include/ldap.h @@ -176,7 +176,6 @@ typedef struct ldapcontrol { /* 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 */ @@ -208,25 +207,6 @@ typedef struct ldapcontrol { #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 */ @@ -242,16 +222,6 @@ typedef struct ldapcontrol { #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 @@ -264,15 +234,6 @@ typedef struct ldapcontrol { #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 */ @@ -286,20 +247,6 @@ typedef struct ldapcontrol { #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 */ @@ -311,16 +258,6 @@ typedef struct ldapcontrol { #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 diff --git a/servers/slapd/bind.c b/servers/slapd/bind.c index c72368608e..0d380079a8 100644 --- a/servers/slapd/bind.c +++ b/servers/slapd/bind.c @@ -51,32 +51,7 @@ do_bind( * } */ -#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 ); @@ -85,24 +60,6 @@ do_bind( 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 ); diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index 213f3f45d2..4def5161be 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -392,9 +392,6 @@ connection_destroy( Connection *c ) backend_connection_destroy(c); -#ifdef LDAP_COMPAT30 - c->c_version = 0; -#endif c->c_protocol = 0; c->c_activitytime = c->c_starttime = 0; @@ -616,9 +613,6 @@ connection_operation( void *arg_v ) 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; @@ -627,9 +621,6 @@ connection_operation( void *arg_v ) 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; @@ -650,9 +641,6 @@ connection_operation( void *arg_v ) 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; @@ -683,9 +671,6 @@ connection_operation( void *arg_v ) arg = NULL; switch( tag ) { -#ifdef LDAP_COMPAT30 - case LDAP_REQ_UNBIND_30: -#endif case LDAP_REQ_UNBIND: /* c_mutex is locked */ connection_closing( conn ); @@ -835,12 +820,6 @@ connection_input( 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 diff --git a/servers/slapd/filter.c b/servers/slapd/filter.c index 5176842df1..7ea1850916 100644 --- a/servers/slapd/filter.c +++ b/servers/slapd/filter.c @@ -52,25 +52,7 @@ get_filter( Connection *conn, BerElement *ber, Filter **filt, char **fstr ) 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 ); @@ -193,11 +175,6 @@ get_filter_list( Connection *conn, BerElement *ber, Filter **f, char **fstr ) 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; @@ -236,11 +213,6 @@ get_substring_filter( 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 ); } @@ -254,11 +226,6 @@ get_substring_filter( 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 ); @@ -272,9 +239,6 @@ get_substring_filter( 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 ) { @@ -286,9 +250,6 @@ get_substring_filter( 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 ); @@ -298,9 +259,6 @@ get_substring_filter( 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 ) { diff --git a/servers/slapd/result.c b/servers/slapd/result.c index 901afcc012..4a99e13453 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -57,11 +57,8 @@ send_ldap_result2( } -#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; @@ -73,14 +70,10 @@ send_ldap_result2( 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 ); @@ -215,11 +208,7 @@ send_search_entry( 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 ); @@ -228,16 +217,8 @@ send_search_entry( 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 ); @@ -312,12 +293,7 @@ send_search_entry( } } -#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 ); diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 99e9747df5..e34f4e38f3 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -534,10 +534,6 @@ typedef struct slap_conn { 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 */ -- 2.39.5