From: Pierangelo Masarati Date: Fri, 6 Jul 2007 08:22:10 +0000 (+0000) Subject: trim unneeded arg (ITS#5041) X-Git-Tag: OPENLDAP_REL_ENG_2_4_MP~348 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1734ae7e1ce5183ecaf9abce6947b3d248d47df2;p=openldap trim unneeded arg (ITS#5041) --- diff --git a/clients/tools/ldapexop.c b/clients/tools/ldapexop.c index 59632de3c2..5a53b5be7e 100644 --- a/clients/tools/ldapexop.c +++ b/clients/tools/ldapexop.c @@ -66,7 +66,6 @@ int main( int argc, char *argv[] ) { int rc; - char *user = NULL; LDAP *ld = NULL; @@ -104,18 +103,6 @@ main( int argc, char *argv[] ) argc -= optind; if ( strcasecmp( argv[ 0 ], "whoami" ) == 0 ) { - switch ( argc ) { - case 2: - user = argv[ 1 ]; - - case 1: - break; - - default: - fprintf( stderr, "need [user]\n\n" ); - usage(); - } - tool_server_controls( ld, NULL, 0 ); rc = ldap_whoami( ld, NULL, NULL, &id ); diff --git a/clients/tools/ldapwhoami.c b/clients/tools/ldapwhoami.c index daaf254a2c..08ca1414de 100644 --- a/clients/tools/ldapwhoami.c +++ b/clients/tools/ldapwhoami.c @@ -109,10 +109,7 @@ int main( int argc, char *argv[] ) { int rc; - char *user = NULL; - LDAP *ld = NULL; - char *matcheddn = NULL, *text = NULL, **refs = NULL; char *retoid = NULL; struct berval *retdata = NULL; @@ -128,12 +125,8 @@ main( int argc, char *argv[] ) tool_args( argc, argv ); - if( argc - optind > 1 ) { + if( argc - optind > 0 ) { usage(); - } else if ( argc - optind == 1 ) { - user = strdup( argv[optind] ); - } else { - user = NULL; } if ( pw_file || want_bindpw ) {