From d0d709faddddf725e71737dfc51561e6e4e0b025 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 10 Jan 2007 00:01:38 +0000 Subject: [PATCH] ITS#4799 remove kbind --- clients/tools/common.c | 58 ------------------------------------- clients/tools/ldapcompare.c | 2 +- clients/tools/ldapdelete.c | 2 +- clients/tools/ldapmodify.c | 2 +- clients/tools/ldapmodrdn.c | 2 +- clients/tools/ldappasswd.c | 3 ++ clients/tools/ldapsearch.c | 2 +- 7 files changed, 8 insertions(+), 63 deletions(-) diff --git a/clients/tools/common.c b/clients/tools/common.c index 3801c2fd79..4cf7edcd40 100644 --- a/clients/tools/common.c +++ b/clients/tools/common.c @@ -53,18 +53,6 @@ #include "common.h" -#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND -#if !LDAP_DEPRECATED -/* Necessary for old LDAPv2 Kerberos Bind methods */ -LDAP_F( int ) -ldap_bind LDAP_P(( /* deprecated */ - LDAP *ld, - LDAP_CONST char *who, - LDAP_CONST char *passwd, - int authmethod )); -#endif -#endif - /* input-related vars */ /* misc. parameters */ @@ -219,8 +207,6 @@ N_(" -f file read operations from `file'\n"), N_(" -h host LDAP server\n"), N_(" -H URI LDAP Uniform Resource Indentifier(s)\n"), N_(" -I use SASL Interactive mode\n"), -N_(" -k use Kerberos authentication\n"), -N_(" -K like -k, but do only step 1 of the Kerberos bind\n"), N_(" -M enable Manage DSA IT control (-MM to make critical)\n"), N_(" -n show what would be done but don't actually do it\n"), N_(" -O props SASL security properties\n"), @@ -563,32 +549,6 @@ tool_args( int argc, char **argv ) prog ); exit( EXIT_FAILURE ); #endif - case 'k': /* kerberos bind */ -#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND - if( authmethod != -1 ) { - fprintf( stderr, "%s: -k incompatible with previous " - "authentication choice\n", prog ); - exit( EXIT_FAILURE ); - } - authmethod = LDAP_AUTH_KRBV4; -#else - fprintf( stderr, "%s: not compiled with Kerberos support\n", prog ); - exit( EXIT_FAILURE ); -#endif - break; - case 'K': /* kerberos bind, part one only */ -#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND - if( authmethod != -1 ) { - fprintf( stderr, "%s: incompatible with previous " - "authentication choice\n", prog ); - exit( EXIT_FAILURE ); - } - authmethod = LDAP_AUTH_KRBV41; -#else - fprintf( stderr, "%s: not compiled with Kerberos support\n", prog ); - exit( EXIT_FAILURE ); -#endif - break; case 'M': /* enable Manage DSA IT */ manageDSAit++; @@ -937,15 +897,6 @@ tool_args( int argc, char **argv ) exit( EXIT_FAILURE ); } #endif - -#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND - } else { - if ( authmethod == LDAP_AUTH_KRBV4 || authmethod == LDAP_AUTH_KRBV41 ) { - fprintf( stderr, "%s: -k/-K incompatible with LDAPv%d\n", - prog, protocol ); - exit( EXIT_FAILURE ); - } -#endif } } @@ -1124,15 +1075,6 @@ tool_bind( LDAP *ld ) msgbuf[0] = 0; -#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND - if ( authmethod == LDAP_AUTH_KRBV4 || authmethod == LDAP_AUTH_KRBV41 ) { - msgid = ldap_bind( ld, binddn, passwd.bv_val, authmethod ); - if ( msgid == -1 ) { - tool_perror( "ldap_bind", -1, NULL, NULL, NULL, NULL ); - exit( LDAP_LOCAL_ERROR ); - } - } else -#endif { /* simple bind */ rc = ldap_sasl_bind( ld, binddn, LDAP_SASL_SIMPLE, &passwd, diff --git a/clients/tools/ldapcompare.c b/clients/tools/ldapcompare.c index 6e9d70c4f6..47753525e1 100644 --- a/clients/tools/ldapcompare.c +++ b/clients/tools/ldapcompare.c @@ -102,7 +102,7 @@ static int docompare LDAP_P(( const char options[] = "z" - "Cd:D:e:h:H:IkKMnO:o:p:P:QR:U:vVw:WxX:y:Y:Z"; + "Cd:D:e:h:H:IMnO:o:p:P:QR:U:vVw:WxX:y:Y:Z"; #ifdef LDAP_CONTROL_DONTUSECOPY int dontUseCopy = 0; diff --git a/clients/tools/ldapdelete.c b/clients/tools/ldapdelete.c index 545841ea09..8133a2d3a0 100644 --- a/clients/tools/ldapdelete.c +++ b/clients/tools/ldapdelete.c @@ -76,7 +76,7 @@ usage( void ) const char options[] = "r" - "cd:D:e:f:h:H:IkKMnO:o:p:P:QR:U:vVw:WxX:y:Y:Z"; + "cd:D:e:f:h:H:IMnO:o:p:P:QR:U:vVw:WxX:y:Y:Z"; int handle_private_option( int i ) diff --git a/clients/tools/ldapmodify.c b/clients/tools/ldapmodify.c index feda1b3413..e53048236b 100644 --- a/clients/tools/ldapmodify.c +++ b/clients/tools/ldapmodify.c @@ -154,7 +154,7 @@ usage( void ) const char options[] = "aE:FrS:" - "cd:D:e:f:h:H:IkKMnO:o:p:P:QR:U:vVw:WxX:y:Y:Z"; + "cd:D:e:f:h:H:IMnO:o:p:P:QR:U:vVw:WxX:y:Y:Z"; int handle_private_option( int i ) diff --git a/clients/tools/ldapmodrdn.c b/clients/tools/ldapmodrdn.c index c3ea85a25f..9b03471f47 100644 --- a/clients/tools/ldapmodrdn.c +++ b/clients/tools/ldapmodrdn.c @@ -91,7 +91,7 @@ usage( void ) const char options[] = "rs:" - "cd:D:e:f:h:H:IkKMnO:o:p:P:QR:U:vVw:WxX:y:Y:Z"; + "cd:D:e:f:h:H:IMnO:o:p:P:QR:U:vVw:WxX:y:Y:Z"; int handle_private_option( int i ) diff --git a/clients/tools/ldappasswd.c b/clients/tools/ldappasswd.c index 9e0cbbd206..7645e55e0a 100644 --- a/clients/tools/ldappasswd.c +++ b/clients/tools/ldappasswd.c @@ -411,6 +411,9 @@ main( int argc, char *argv[] ) ber_memfree( retoid ); ber_bvfree( retdata ); + rc = ldap_search_s( ld, binddn, LDAP_SCOPE_BASE, "(objectclass=*)", + NULL, 0, &res ); + rc = ( code == LDAP_SUCCESS ) ? EXIT_SUCCESS : EXIT_FAILURE; done: diff --git a/clients/tools/ldapsearch.c b/clients/tools/ldapsearch.c index 2e22f6ab34..79bee8e678 100644 --- a/clients/tools/ldapsearch.c +++ b/clients/tools/ldapsearch.c @@ -249,7 +249,7 @@ urlize(char *url) const char options[] = "a:Ab:cE:F:l:Ls:S:tT:uz:" - "Cd:D:e:f:h:H:IkKMnO:o:p:P:QR:U:vVw:WxX:y:Y:Z"; + "Cd:D:e:f:h:H:IMnO:o:p:P:QR:U:vVw:WxX:y:Y:Z"; int handle_private_option( int i ) -- 2.39.5