From 5417fdfea7004888c3f40840f8ed1c29fa738581 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Tue, 13 Jun 2000 20:45:30 +0000 Subject: [PATCH] Rename ldap_start_tls() to ldap_start_tls_s() for consistency sake. Misc other header changes. --- clients/tools/ldapdelete.c | 2 +- clients/tools/ldapmodify.c | 2 +- clients/tools/ldapmodrdn.c | 2 +- clients/tools/ldappasswd.c | 2 +- clients/tools/ldapsearch.c | 2 +- include/ldap.h | 54 +++++++++++------------------------ libraries/libldap/libldap.dsp | 4 +++ libraries/libldap/open.c | 4 ++- 8 files changed, 29 insertions(+), 43 deletions(-) diff --git a/clients/tools/ldapdelete.c b/clients/tools/ldapdelete.c index 6e06b769e3..4dc1d532cb 100644 --- a/clients/tools/ldapdelete.c +++ b/clients/tools/ldapdelete.c @@ -310,7 +310,7 @@ main( int argc, char **argv ) fprintf( stderr, "Could not set LDAP_OPT_PROTOCOL_VERSION %d\n", version ); } - if ( use_tls && ldap_start_tls( ld, NULL, NULL ) != LDAP_SUCCESS ) { + if ( use_tls && ldap_start_tls_s( ld, NULL, NULL ) != LDAP_SUCCESS ) { if ( use_tls > 1 ) { ldap_perror( ld, "ldap_start_tls" ); return( EXIT_FAILURE ); diff --git a/clients/tools/ldapmodify.c b/clients/tools/ldapmodify.c index d2b453cd1e..352c79a40f 100644 --- a/clients/tools/ldapmodify.c +++ b/clients/tools/ldapmodify.c @@ -374,7 +374,7 @@ main( int argc, char **argv ) fprintf( stderr, "Could not set LDAP_OPT_PROTOCOL_VERSION to %d\n", version ); } - if ( use_tls && ldap_start_tls( ld, NULL, NULL ) != LDAP_SUCCESS ) { + if ( use_tls && ldap_start_tls_s( ld, NULL, NULL ) != LDAP_SUCCESS ) { if ( use_tls > 1 ) { ldap_perror( ld, "ldap_start_tls" ); return( EXIT_FAILURE ); diff --git a/clients/tools/ldapmodrdn.c b/clients/tools/ldapmodrdn.c index 3aa05b10f0..d26b741474 100644 --- a/clients/tools/ldapmodrdn.c +++ b/clients/tools/ldapmodrdn.c @@ -357,7 +357,7 @@ main(int argc, char **argv) fprintf( stderr, "Could not set LDAP_OPT_PROTOCOL_VERSION %d\n", version ); } - if ( use_tls && ldap_start_tls( ld, NULL, NULL ) != LDAP_SUCCESS ) { + if ( use_tls && ldap_start_tls_s( ld, NULL, NULL ) != LDAP_SUCCESS ) { if ( use_tls > 1 ) { ldap_perror( ld, "ldap_start_tls" ); return( EXIT_FAILURE ); diff --git a/clients/tools/ldappasswd.c b/clients/tools/ldappasswd.c index 18b19c2d61..ba01854048 100644 --- a/clients/tools/ldappasswd.c +++ b/clients/tools/ldappasswd.c @@ -314,7 +314,7 @@ main( int argc, char *argv[] ) fprintf( stderr, "Could not set LDAP_OPT_PROTOCOL_VERSION %d\n", version ); } - if ( use_tls && ldap_start_tls( ld, NULL, NULL ) != LDAP_SUCCESS ) { + if ( use_tls && ldap_start_tls_s( ld, NULL, NULL ) != LDAP_SUCCESS ) { if ( use_tls > 1 ) { ldap_perror( ld, "ldap_start_tls" ); return( EXIT_FAILURE ); diff --git a/clients/tools/ldapsearch.c b/clients/tools/ldapsearch.c index 0bae49a3e1..8b8aa3ee00 100644 --- a/clients/tools/ldapsearch.c +++ b/clients/tools/ldapsearch.c @@ -517,7 +517,7 @@ main( int argc, char **argv ) fprintf( stderr, "Could not set LDAP_OPT_PROTOCOL_VERSION %d\n", version ); } - if ( use_tls && ldap_start_tls( ld, NULL, NULL ) != LDAP_SUCCESS ) { + if ( use_tls && ldap_start_tls_s( ld, NULL, NULL ) != LDAP_SUCCESS ) { if ( use_tls > 1 ) { ldap_perror( ld, "ldap_start_tls" ); return( EXIT_FAILURE ); diff --git a/include/ldap.h b/include/ldap.h index 460d381177..911c4e9180 100644 --- a/include/ldap.h +++ b/include/ldap.h @@ -376,7 +376,7 @@ typedef struct ldapcontrol { #define LDAP_OTHER 0x50 -#define LDAP_API_ERROR(n) LDAP_RANGE((n),0x51,0xff) /* 81+ */ +#define LDAP_API_ERROR(n) LDAP_RANGE((n),0x51,0x61) /* 81-97 */ #define LDAP_SERVER_DOWN 0x51 #define LDAP_LOCAL_ERROR 0x52 @@ -389,13 +389,14 @@ typedef struct ldapcontrol { #define LDAP_PARAM_ERROR 0x59 #define LDAP_NO_MEMORY 0x5a -#define LDAP_CONNECT_ERROR 0x5b /* new */ -#define LDAP_NOT_SUPPORTED 0x5c /* new */ -#define LDAP_CONTROL_NOT_FOUND 0x5d /* new */ -#define LDAP_NO_RESULTS_RETURNED 0x5e /* new */ -#define LDAP_MORE_RESULTS_TO_RETURN 0x5f /* new */ -#define LDAP_CLIENT_LOOP 0x60 /* new */ -#define LDAP_REFERRAL_LIMIT_EXCEEDED 0x61 /* new */ +/* not technically reserved for APIs */ +#define LDAP_CONNECT_ERROR 0x5b /* draft-ietf-ldap-c-api-xx */ +#define LDAP_NOT_SUPPORTED 0x5c /* draft-ietf-ldap-c-api-xx */ +#define LDAP_CONTROL_NOT_FOUND 0x5d /* draft-ietf-ldap-c-api-xx */ +#define LDAP_NO_RESULTS_RETURNED 0x5e /* draft-ietf-ldap-c-api-xx */ +#define LDAP_MORE_RESULTS_TO_RETURN 0x5f /* draft-ietf-ldap-c-api-xx */ +#define LDAP_CLIENT_LOOP 0x60 /* draft-ietf-ldap-c-api-xx */ +#define LDAP_REFERRAL_LIMIT_EXCEEDED 0x61 /* draft-ietf-ldap-c-api-xx */ /* * This structure represents both ldap messages and ldap responses. @@ -612,17 +613,17 @@ ldap_parse_extended_result LDAP_P(( * in abandon.c: */ LIBLDAP_F( int ) -ldap_abandon LDAP_P(( /* deprecated */ - LDAP *ld, - int msgid )); - -LIBLDAP_F( int ) ldap_abandon_ext LDAP_P(( LDAP *ld, int msgid, LDAPControl **serverctrls, LDAPControl **clientctrls )); +LIBLDAP_F( int ) +ldap_abandon LDAP_P(( /* deprecated */ + LDAP *ld, + int msgid )); + /* * in add.c: @@ -940,27 +941,6 @@ ldap_rename_s LDAP_P(( LDAPControl **sctrls, LDAPControl **cctrls )); -LIBLDAP_F( int ) -ldap_rename_ext LDAP_P(( - LDAP *ld, - LDAP_CONST char *dn, - LDAP_CONST char *newrdn, - LDAP_CONST char *newparent, - int deleteoldrdn, - LDAPControl **serverctrls, - LDAPControl **clientctrls, - int *msgidp )); - -LIBLDAP_F( int ) -ldap_rename_ext_s LDAP_P(( - LDAP *ld, - LDAP_CONST char *dn, - LDAP_CONST char *newrdn, - LDAP_CONST char *newparent, - int deleteoldrdn, - LDAPControl **serverctrls, - LDAPControl **clientctrls )); - LIBLDAP_F( int ) ldap_rename2 LDAP_P(( /* deprecated */ LDAP *ld, @@ -1008,12 +988,12 @@ ldap_modrdn2_s LDAP_P(( /* deprecated */ * in open.c: */ LIBLDAP_F( LDAP *) -ldap_open LDAP_P(( /* deprecated */ +ldap_init LDAP_P(( LDAP_CONST char *host, int port )); LIBLDAP_F( LDAP *) -ldap_init LDAP_P(( +ldap_open LDAP_P(( /* deprecated */ LDAP_CONST char *host, int port )); @@ -1027,7 +1007,7 @@ ldap_initialize LDAP_P(( LDAP_CONST char *url )); LIBLDAP_F( int ) -ldap_start_tls LDAP_P(( +ldap_start_tls_s LDAP_P(( LDAP *ld, LDAPControl **serverctrls, LDAPControl **clientctrls )); diff --git a/libraries/libldap/libldap.dsp b/libraries/libldap/libldap.dsp index 5a9f03affc..0ba5b193b5 100644 --- a/libraries/libldap/libldap.dsp +++ b/libraries/libldap/libldap.dsp @@ -351,6 +351,10 @@ SOURCE=.\tls.c # End Source File # Begin Source File +SOURCE=.\tmplout.c +# End Source File +# Begin Source File + SOURCE=.\ufn.c # End Source File # Begin Source File diff --git a/libraries/libldap/open.c b/libraries/libldap/open.c index 938739d7eb..f0a5a593df 100644 --- a/libraries/libldap/open.c +++ b/libraries/libldap/open.c @@ -230,7 +230,7 @@ ldap_initialize( LDAP **ldp, LDAP_CONST char *url ) } int -ldap_start_tls ( LDAP *ld, +ldap_start_tls_s ( LDAP *ld, LDAPControl **serverctrls, LDAPControl **clientctrls ) { @@ -249,8 +249,10 @@ ldap_start_tls ( LDAP *ld, for (lc = ld->ld_conns; lc != NULL; lc = lc->lconn_next) { if (ldap_pvt_tls_inplace(lc->lconn_sb) != 0) return LDAP_OPERATIONS_ERROR; + rc = ldap_extended_operation_s(ld, LDAP_EXOP_START_TLS, NULL, serverctrls, clientctrls, &rspoid, &rspdata); + if (rc != LDAP_SUCCESS) return rc; if (rspoid != NULL) -- 2.39.5