mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-15 03:01:09 +08:00
remove old STR_TRANSLATION feature. The use of this feature
was only of limited use with LDAPv2 (worked okay if no non-T.61 values existed) but downright dangerous in the face of LDAPv3. Any translation must be schema aware and the BER isn't.
This commit is contained in:
parent
ca6de2138e
commit
c1117666b1
2
configure
vendored
2
configure
vendored
@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# $OpenLDAP$
|
||||
# from OpenLDAP: pkg/ldap/configure.in,v 1.305 2000/06/01 21:00:24 kurt Exp
|
||||
# from OpenLDAP: pkg/ldap/configure.in,v 1.306 2000/06/05 05:19:11 kurt Exp
|
||||
|
||||
# Copyright 1998-2000 The OpenLDAP Foundation. All Rights Reserved.
|
||||
#
|
||||
|
@ -80,15 +80,9 @@ LDAP_BEGIN_DECL
|
||||
#define LBER_SEQUENCE ((ber_tag_t) 0x30UL) /* constructed */
|
||||
#define LBER_SET ((ber_tag_t) 0x31UL) /* constructed */
|
||||
|
||||
typedef int (*BERTranslateProc) LDAP_P((
|
||||
char **bufp,
|
||||
ber_len_t *buflenp,
|
||||
int free_input ));
|
||||
|
||||
/* LBER BerElement options */
|
||||
#define LBER_USE_DER 0x01
|
||||
#define LBER_USE_INDEFINITE_LEN 0x02
|
||||
#define LBER_TRANSLATE_STRINGS 0x04 /* deprecated */
|
||||
|
||||
/* get/set options for BerElement */
|
||||
#define LBER_OPT_BER_OPTIONS 0x01
|
||||
@ -306,12 +300,6 @@ ber_scanf LDAP_P((
|
||||
LDAP_CONST char *fmt,
|
||||
... ));
|
||||
|
||||
LIBLBER_F( void )
|
||||
ber_set_string_translators LDAP_P((
|
||||
BerElement *ber,
|
||||
BERTranslateProc encode_proc,
|
||||
BERTranslateProc decode_proc ));
|
||||
|
||||
/*
|
||||
* in encode.c
|
||||
*/
|
||||
|
@ -44,7 +44,7 @@ LDAP_BEGIN_DECL
|
||||
#define LDAP_API_VERSION 2004
|
||||
#define LDAP_VENDOR_NAME "OpenLDAP"
|
||||
/* We'll eventually release as 200 */
|
||||
#define LDAP_VENDOR_VERSION 194
|
||||
#define LDAP_VENDOR_VERSION 19905
|
||||
|
||||
/* OpenLDAP API Features */
|
||||
#define LDAP_API_FEATURE_X_OPENLDAP LDAP_VENDOR_VERSION
|
||||
@ -1574,49 +1574,6 @@ ldap_url_search_st LDAP_P((
|
||||
struct timeval *timeout,
|
||||
LDAPMessage **res ));
|
||||
|
||||
|
||||
/*
|
||||
* in charset.c
|
||||
* DEPRECATED
|
||||
*/
|
||||
LIBLDAP_F( void )
|
||||
ldap_set_string_translators LDAP_P((
|
||||
LDAP *ld,
|
||||
BERTranslateProc encode_proc,
|
||||
BERTranslateProc decode_proc ));
|
||||
|
||||
LIBLDAP_F( int )
|
||||
ldap_translate_from_t61 LDAP_P((
|
||||
LDAP *ld,
|
||||
char **bufp,
|
||||
ber_len_t *lenp,
|
||||
int free_input ));
|
||||
|
||||
LIBLDAP_F( int )
|
||||
ldap_translate_to_t61 LDAP_P((
|
||||
LDAP *ld,
|
||||
char **bufp,
|
||||
ber_len_t *lenp,
|
||||
int free_input ));
|
||||
|
||||
LIBLDAP_F( void )
|
||||
ldap_enable_translation LDAP_P((
|
||||
LDAP *ld,
|
||||
LDAPMessage *entry,
|
||||
int enable ));
|
||||
|
||||
LIBLDAP_F( int )
|
||||
ldap_t61_to_8859 LDAP_P((
|
||||
char **bufp,
|
||||
ber_len_t *buflenp,
|
||||
int free_input ));
|
||||
|
||||
LIBLDAP_F( int )
|
||||
ldap_8859_to_t61 LDAP_P((
|
||||
char **bufp,
|
||||
ber_len_t *buflenp,
|
||||
int free_input ));
|
||||
|
||||
LDAP_END_DECL
|
||||
|
||||
#endif /* _LDAP_H */
|
||||
|
@ -245,10 +245,6 @@ ber_get_stringb(
|
||||
ber_len_t datalen;
|
||||
ber_tag_t tag;
|
||||
|
||||
#ifdef STR_TRANSLATION
|
||||
char *transbuf;
|
||||
#endif /* STR_TRANSLATION */
|
||||
|
||||
assert( ber != NULL );
|
||||
assert( BER_VALID( ber ) );
|
||||
|
||||
@ -262,25 +258,6 @@ ber_get_stringb(
|
||||
|
||||
buf[datalen] = '\0';
|
||||
|
||||
#ifdef STR_TRANSLATION
|
||||
if ( datalen > 0 && ( ber->ber_options & LBER_TRANSLATE_STRINGS ) != 0
|
||||
&& ber->ber_decode_translate_proc ) {
|
||||
transbuf = buf;
|
||||
++datalen;
|
||||
if ( (*(ber->ber_decode_translate_proc))( &transbuf, &datalen,
|
||||
0 ) != 0 ) {
|
||||
return( LBER_DEFAULT );
|
||||
}
|
||||
if ( datalen > *len ) {
|
||||
LBER_FREE( transbuf );
|
||||
return( LBER_DEFAULT );
|
||||
}
|
||||
SAFEMEMCPY( buf, transbuf, datalen );
|
||||
LBER_FREE( transbuf );
|
||||
--datalen;
|
||||
}
|
||||
#endif /* STR_TRANSLATION */
|
||||
|
||||
*len = datalen;
|
||||
return( tag );
|
||||
}
|
||||
@ -311,19 +288,6 @@ ber_get_stringa( BerElement *ber, char **buf )
|
||||
}
|
||||
(*buf)[datalen] = '\0';
|
||||
|
||||
#ifdef STR_TRANSLATION
|
||||
if ( datalen > 0 && ( ber->ber_options & LBER_TRANSLATE_STRINGS ) != 0
|
||||
&& ber->ber_decode_translate_proc ) {
|
||||
++datalen;
|
||||
if ( (*(ber->ber_decode_translate_proc))( buf, &datalen, 1 )
|
||||
!= 0 ) {
|
||||
LBER_FREE( *buf );
|
||||
*buf = NULL;
|
||||
return( LBER_DEFAULT );
|
||||
}
|
||||
}
|
||||
#endif /* STR_TRANSLATION */
|
||||
|
||||
return( tag );
|
||||
}
|
||||
|
||||
@ -360,20 +324,6 @@ ber_get_stringal( BerElement *ber, struct berval **bv )
|
||||
((*bv)->bv_val)[len] = '\0';
|
||||
(*bv)->bv_len = len;
|
||||
|
||||
#ifdef STR_TRANSLATION
|
||||
if ( len > 0 && ( ber->ber_options & LBER_TRANSLATE_STRINGS ) != 0
|
||||
&& ber->ber_decode_translate_proc ) {
|
||||
++len;
|
||||
if ( (*(ber->ber_decode_translate_proc))( &((*bv)->bv_val),
|
||||
&len, 1 ) != 0 ) {
|
||||
ber_bvfree( *bv );
|
||||
*bv = NULL;
|
||||
return( LBER_DEFAULT );
|
||||
}
|
||||
(*bv)->bv_len = len - 1;
|
||||
}
|
||||
#endif /* STR_TRANSLATION */
|
||||
|
||||
return( tag );
|
||||
}
|
||||
|
||||
@ -778,17 +728,3 @@ ber_scanf ( BerElement *ber,
|
||||
|
||||
return( rc );
|
||||
}
|
||||
|
||||
|
||||
#ifdef STR_TRANSLATION
|
||||
void
|
||||
ber_set_string_translators( BerElement *ber, BERTranslateProc encode_proc,
|
||||
BERTranslateProc decode_proc )
|
||||
{
|
||||
assert( ber != NULL );
|
||||
assert( BER_VALID( ber ) );
|
||||
|
||||
ber->ber_encode_translate_proc = encode_proc;
|
||||
ber->ber_decode_translate_proc = decode_proc;
|
||||
}
|
||||
#endif /* STR_TRANSLATION */
|
||||
|
@ -278,9 +278,6 @@ ber_put_ostring(
|
||||
{
|
||||
ber_len_t taglen, lenlen;
|
||||
int rc;
|
||||
#ifdef STR_TRANSLATION
|
||||
int free_str;
|
||||
#endif /* STR_TRANSLATION */
|
||||
|
||||
assert( ber != NULL );
|
||||
assert( str != NULL );
|
||||
@ -293,18 +290,6 @@ ber_put_ostring(
|
||||
if ( (taglen = ber_put_tag( ber, tag, 0 )) == -1 )
|
||||
return( -1 );
|
||||
|
||||
#ifdef STR_TRANSLATION
|
||||
if ( len > 0 && ( ber->ber_options & LBER_TRANSLATE_STRINGS ) != 0 &&
|
||||
ber->ber_encode_translate_proc ) {
|
||||
if ( (*(ber->ber_encode_translate_proc))( &str, &len, 0 ) != 0 ) {
|
||||
return( -1 );
|
||||
}
|
||||
free_str = 1;
|
||||
} else {
|
||||
free_str = 0;
|
||||
}
|
||||
#endif /* STR_TRANSLATION */
|
||||
|
||||
if ( (lenlen = ber_put_len( ber, len, 0 )) == -1 ||
|
||||
(ber_len_t) ber_write( ber, str, len, 0 ) != len ) {
|
||||
rc = -1;
|
||||
@ -313,12 +298,6 @@ ber_put_ostring(
|
||||
rc = taglen + lenlen + len;
|
||||
}
|
||||
|
||||
#ifdef STR_TRANSLATION
|
||||
if ( free_str ) {
|
||||
LBER_FREE( str );
|
||||
}
|
||||
#endif /* STR_TRANSLATION */
|
||||
|
||||
return( rc );
|
||||
}
|
||||
|
||||
|
@ -57,8 +57,6 @@ struct berelement {
|
||||
|
||||
struct seqorset *ber_sos;
|
||||
char *ber_rwptr;
|
||||
BERTranslateProc ber_encode_translate_proc;
|
||||
BERTranslateProc ber_decode_translate_proc;
|
||||
};
|
||||
#define BER_VALID(ber) ((ber)->ber_valid==LBER_VALID_BERELEMENT)
|
||||
|
||||
|
@ -15,7 +15,7 @@ SRCS = bind.c open.c result.c error.c compare.c search.c \
|
||||
getfilter.c sasl.c sbind.c kbind.c unbind.c friendly.c cldap.c \
|
||||
free.c disptmpl.c srchpref.c dsparse.c tmplout.c sort.c \
|
||||
getdn.c getentry.c getattr.c getvalues.c addentry.c \
|
||||
request.c os-ip.c url.c charset.c \
|
||||
request.c os-ip.c url.c \
|
||||
init.c options.c print.c string.c util-int.c schema.c \
|
||||
charray.c digest.c tls.c dn.c os-local.c dnssrv.c \
|
||||
utf-8.c
|
||||
@ -25,7 +25,7 @@ OBJS = bind.lo open.lo result.lo error.lo compare.lo search.lo \
|
||||
getfilter.lo sasl.lo sbind.lo kbind.lo unbind.lo friendly.lo cldap.lo \
|
||||
free.lo disptmpl.lo srchpref.lo dsparse.lo tmplout.lo sort.lo \
|
||||
getdn.lo getentry.lo getattr.lo getvalues.lo addentry.lo \
|
||||
request.lo os-ip.lo url.lo charset.lo \
|
||||
request.lo os-ip.lo url.lo \
|
||||
init.lo options.lo print.lo string.lo util-int.lo schema.lo \
|
||||
charray.lo digest.lo tls.lo dn.lo os-local.lo dnssrv.lo \
|
||||
utf-8.lo
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -63,9 +63,6 @@ ldap_kerberos_bind1( LDAP *ld, LDAP_CONST char *dn )
|
||||
char *cred;
|
||||
int rc;
|
||||
ber_len_t credlen;
|
||||
#ifdef STR_TRANSLATION
|
||||
int str_translation_on;
|
||||
#endif /* STR_TRANSLATION */
|
||||
|
||||
Debug( LDAP_DEBUG_TRACE, "ldap_kerberos_bind1\n", 0, 0, 0 );
|
||||
|
||||
@ -83,23 +80,10 @@ ldap_kerberos_bind1( LDAP *ld, LDAP_CONST char *dn )
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
#ifdef STR_TRANSLATION
|
||||
if (( str_translation_on = (( ber->ber_options &
|
||||
LBER_TRANSLATE_STRINGS ) != 0 ))) { /* turn translation off */
|
||||
ber->ber_options &= ~LBER_TRANSLATE_STRINGS;
|
||||
}
|
||||
#endif /* STR_TRANSLATION */
|
||||
|
||||
/* fill it in */
|
||||
rc = ber_printf( ber, "{it{isto}}", ++ld->ld_msgid, LDAP_REQ_BIND,
|
||||
ld->ld_version, dn, LDAP_AUTH_KRBV41, cred, credlen );
|
||||
|
||||
#ifdef STR_TRANSLATION
|
||||
if ( str_translation_on ) { /* restore translation */
|
||||
ber->ber_options |= LBER_TRANSLATE_STRINGS;
|
||||
}
|
||||
#endif /* STR_TRANSLATION */
|
||||
|
||||
if ( rc == -1 ) {
|
||||
LDAP_FREE( cred );
|
||||
ber_free( ber, 1 );
|
||||
@ -157,9 +141,6 @@ ldap_kerberos_bind2( LDAP *ld, LDAP_CONST char *dn )
|
||||
char *cred;
|
||||
int rc;
|
||||
ber_len_t credlen;
|
||||
#ifdef STR_TRANSLATION
|
||||
int str_translation_on;
|
||||
#endif /* STR_TRANSLATION */
|
||||
|
||||
Debug( LDAP_DEBUG_TRACE, "ldap_kerberos_bind2\n", 0, 0, 0 );
|
||||
|
||||
@ -177,24 +158,11 @@ ldap_kerberos_bind2( LDAP *ld, LDAP_CONST char *dn )
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
#ifdef STR_TRANSLATION
|
||||
if (( str_translation_on = (( ber->ber_options &
|
||||
LBER_TRANSLATE_STRINGS ) != 0 ))) { /* turn translation off */
|
||||
ber->ber_options &= ~LBER_TRANSLATE_STRINGS;
|
||||
}
|
||||
#endif /* STR_TRANSLATION */
|
||||
|
||||
/* fill it in */
|
||||
rc = ber_printf( ber, "{it{isto}}", ++ld->ld_msgid, LDAP_REQ_BIND,
|
||||
ld->ld_version, dn, LDAP_AUTH_KRBV42, cred, credlen );
|
||||
|
||||
|
||||
#ifdef STR_TRANSLATION
|
||||
if ( str_translation_on ) { /* restore translation */
|
||||
ber->ber_options |= LBER_TRANSLATE_STRINGS;
|
||||
}
|
||||
#endif /* STR_TRANSLATION */
|
||||
|
||||
LDAP_FREE( cred );
|
||||
|
||||
if ( rc == -1 ) {
|
||||
|
@ -279,8 +279,6 @@ struct ldap {
|
||||
void **ld_cldapaddrs;/* addresses to send request to */
|
||||
|
||||
/* do not mess with the rest though */
|
||||
BERTranslateProc ld_lber_encode_translate_proc;
|
||||
BERTranslateProc ld_lber_decode_translate_proc;
|
||||
|
||||
LDAPConn *ld_defconn; /* default connection */
|
||||
LDAPConn *ld_conns; /* list of server connections */
|
||||
@ -497,21 +495,6 @@ LIBLDAP_F (void) ldap_free_urllist LDAP_P((
|
||||
LDAPURLDesc *ludlist ));
|
||||
|
||||
|
||||
|
||||
#if defined( STR_TRANSLATION ) && defined( LDAP_DEFAULT_CHARSET )
|
||||
/*
|
||||
* in charset.c
|
||||
*
|
||||
* added-in this stuff so that libldap.a would build, i.e. refs to
|
||||
* these routines from open.c would resolve.
|
||||
* hodges@stanford.edu 5-Feb-96
|
||||
*/
|
||||
#if LDAP_CHARSET_8859 == LDAP_DEFAULT_CHARSET
|
||||
LIBLDAP_F (int) ldap_t61_to_8859( char **bufp, ber_len_t *buflenp, int free_input );
|
||||
LIBLDAP_F (int) ldap_8859_to_t61( char **bufp, ber_len_t *buflenp, int free_input );
|
||||
#endif /* LDAP_CHARSET_8859 == LDAP_DEFAULT_CHARSET */
|
||||
#endif /* STR_TRANSLATION && LDAP_DEFAULT_CHARSET */
|
||||
|
||||
LDAP_END_DECL
|
||||
|
||||
#endif /* _LDAP_INT_H */
|
||||
|
@ -155,13 +155,6 @@ ldap_create( LDAP **ldp )
|
||||
|
||||
ld->ld_lberoptions = LBER_USE_DER;
|
||||
|
||||
#if defined( STR_TRANSLATION ) && defined( LDAP_DEFAULT_CHARSET )
|
||||
ld->ld_lberoptions |= LBER_TRANSLATE_STRINGS;
|
||||
#if LDAP_CHARSET_8859 == LDAP_DEFAULT_CHARSET
|
||||
ldap_set_string_translators( ld, ldap_8859_to_t61, ldap_t61_to_8859 );
|
||||
#endif /* LDAP_CHARSET_8859 == LDAP_DEFAULT_CHARSET */
|
||||
#endif /* STR_TRANSLATION && LDAP_DEFAULT_CHARSET */
|
||||
|
||||
ld->ld_sb = ber_sockbuf_alloc( );
|
||||
if ( ld->ld_sb == NULL ) {
|
||||
ldap_free_urllist( ld->ld_options.ldo_defludp );
|
||||
|
@ -61,10 +61,6 @@ ldap_alloc_ber_with_options( LDAP *ld )
|
||||
|
||||
if (( ber = ber_alloc_t( ld->ld_lberoptions )) == NULL ) {
|
||||
ld->ld_errno = LDAP_NO_MEMORY;
|
||||
#ifdef STR_TRANSLATION
|
||||
} else {
|
||||
ldap_set_ber_options( ld, ber );
|
||||
#endif /* STR_TRANSLATION */
|
||||
}
|
||||
|
||||
return( ber );
|
||||
@ -75,13 +71,6 @@ void
|
||||
ldap_set_ber_options( LDAP *ld, BerElement *ber )
|
||||
{
|
||||
ber->ber_options = ld->ld_lberoptions;
|
||||
#ifdef STR_TRANSLATION
|
||||
if (( ld->ld_lberoptions & LBER_TRANSLATE_STRINGS ) != 0 ) {
|
||||
ber_set_string_translators( ber,
|
||||
ld->ld_lber_encode_translate_proc,
|
||||
ld->ld_lber_decode_translate_proc );
|
||||
}
|
||||
#endif /* STR_TRANSLATION */
|
||||
}
|
||||
|
||||
|
||||
|
@ -763,26 +763,6 @@ main( int argc, char **argv )
|
||||
|
||||
LDAP_BOOL_ZERO(&ld->ld_options);
|
||||
|
||||
#ifdef STR_TRANSLATION
|
||||
getline( line, sizeof(line), stdin,
|
||||
"Automatic translation of T.61 strings (0=no, 1=yes)?" );
|
||||
if ( atoi( line ) == 0 ) {
|
||||
ld->ld_lberoptions &= ~LBER_TRANSLATE_STRINGS;
|
||||
} else {
|
||||
ld->ld_lberoptions |= LBER_TRANSLATE_STRINGS;
|
||||
#ifdef LDAP_CHARSET_8859
|
||||
getline( line, sizeof(line), stdin,
|
||||
"Translate to/from ISO-8859 (0=no, 1=yes?" );
|
||||
if ( atoi( line ) != 0 ) {
|
||||
ldap_set_string_translators( ld,
|
||||
ldap_8859_to_t61,
|
||||
ldap_t61_to_8859 );
|
||||
}
|
||||
#endif /* LDAP_CHARSET_8859 */
|
||||
}
|
||||
#endif /* STR_TRANSLATION */
|
||||
|
||||
|
||||
getline( line, sizeof(line), stdin,
|
||||
"Recognize and chase referrals (0=no, 1=yes)?" );
|
||||
if ( atoi( line ) != 0 ) {
|
||||
|
@ -16,7 +16,7 @@ XXSRCS = apitest.c test.c tmpltest.c extended.c \
|
||||
getfilter.c sasl.c sbind.c kbind.c unbind.c friendly.c cldap.c \
|
||||
free.c disptmpl.c srchpref.c dsparse.c tmplout.c sort.c \
|
||||
getdn.c getentry.c getattr.c getvalues.c addentry.c \
|
||||
request.c os-ip.c url.c charset.c \
|
||||
request.c os-ip.c url.c \
|
||||
init.c options.c print.c string.c util-int.c schema.c \
|
||||
charray.c digest.c tls.c dn.c os-local.c dnssrv.c \
|
||||
utf-8.c
|
||||
@ -28,7 +28,7 @@ OBJS = extended.lo \
|
||||
getfilter.lo sasl.lo sbind.lo kbind.lo unbind.lo friendly.lo cldap.lo \
|
||||
free.lo disptmpl.lo srchpref.lo dsparse.lo tmplout.lo sort.lo \
|
||||
getdn.lo getentry.lo getattr.lo getvalues.lo addentry.lo \
|
||||
request.lo os-ip.lo url.lo charset.lo \
|
||||
request.lo os-ip.lo url.lo \
|
||||
init.lo options.lo print.lo string.lo util-int.lo schema.lo \
|
||||
thr_posix.lo thr_cthreads.lo thr_thr.lo thr_lwp.lo thr_nt.lo \
|
||||
thr_pth.lo thr_sleep.lo thr_stub.lo rdwr.lo \
|
||||
|
Loading…
Reference in New Issue
Block a user