main( int argc, char *argv[] )
{
int rc;
- char *user = NULL;
LDAP *ld = NULL;
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 );
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;
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 ) {