]> git.sur5r.net Git - openldap/commitdiff
trim unneeded arg (ITS#5041)
authorPierangelo Masarati <ando@openldap.org>
Fri, 6 Jul 2007 08:22:10 +0000 (08:22 +0000)
committerPierangelo Masarati <ando@openldap.org>
Fri, 6 Jul 2007 08:22:10 +0000 (08:22 +0000)
clients/tools/ldapexop.c
clients/tools/ldapwhoami.c

index 59632de3c2693a773e6132ef848e49a36f4f2712..5a53b5be7e5fccdfd3d9699d9ad9f8ee22598a80 100644 (file)
@@ -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 ); 
index daaf254a2c0bbedc4a29e211aaef4d17973f136e..08ca1414de924bf63bc1e5e25272a48c58b81f95 100644 (file)
@@ -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 ) {