From 1734ae7e1ce5183ecaf9abce6947b3d248d47df2 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Fri, 6 Jul 2007 08:22:10 +0000 Subject: [PATCH] trim unneeded arg (ITS#5041) --- clients/tools/ldapexop.c | 13 ------------- clients/tools/ldapwhoami.c | 9 +-------- 2 files changed, 1 insertion(+), 21 deletions(-) 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 ) { -- 2.39.5