case 'w': /* the server managers password */
passwd.bv_val = strdup( optarg );
passwd.bv_len = strlen( optarg );
+ memset( optarg, '*', passwd.bv_len );
break;
case 'f': /* file with entry search request */
case 'w':
ber_str2bv( optarg, 0, 0, &pass );
+ memset( optarg, '*', pass.bv_len );
break;
case 'l': /* the number of loops */
case 'w': /* the server managers password */
passwd.bv_val = strdup( optarg );
passwd.bv_len = strlen( optarg );
+ memset( optarg, '*', passwd.bv_len );
break;
case 'e': /* entry to modify */
case 'w': /* the server managers password */
passwd.bv_val = strdup( optarg );
passwd.bv_len = strlen( optarg );
+ memset( optarg, '*', passwd.bv_len );
break;
case 'e': /* entry to rename */
case 'w': /* the server managers password */
passwd.bv_val = strdup( optarg );
passwd.bv_len = strlen( optarg );
+ memset( optarg, '*', passwd.bv_len );
break;
case 'e': /* DN to search for */
case 'w': /* the server managers password */
passwd.bv_val = strdup( optarg );
passwd.bv_len = strlen( optarg );
+ memset( optarg, '*', passwd.bv_len );
break;
case 'a':
char bloops[] = "18446744073709551615UL";
char *friendlyOpt = NULL;
+ int pw_ask = 0;
+ char *pw_file = NULL;
tester_init( "slapd-tester", TESTER_TESTER );
- while ( (i = getopt( argc, argv, "ACD:d:FH:h:i:j:l:L:P:p:r:t:w:" )) != EOF ) {
+ while ( (i = getopt( argc, argv, "ACD:d:FH:h:i:j:l:L:P:p:r:t:w:Wy:" )) != EOF ) {
switch( i ) {
case 'A':
noattrs++;
case 'w': /* the managers passwd */
passwd = ArgDup( optarg );
+ memset( optarg, '*', strlen( optarg ) );
+ break;
+
+ case 'W':
+ pw_ask++;
+ break;
+
+ case 'y':
+ pw_file = optarg;
break;
default:
#endif
/* get the file list */
if ( ( datadir = opendir( dirname )) == NULL ) {
-
fprintf( stderr, "%s: couldn't open data directory \"%s\".\n",
argv[0], dirname );
exit( EXIT_FAILURE );
-
}
/* look for search, read, modrdn, and add/delete files */
closedir( datadir );
+ if ( pw_ask ) {
+ passwd = getpassphrase( _("Enter LDAP Password: ") );
+
+ } else if ( pw_file ) {
+ struct berval pw;
+
+ if ( lutil_get_filed_password( pw_file, &pw ) ) {
+ exit( EXIT_FAILURE );
+ }
+
+ passwd = pw.bv_val;
+ }
+
/* look for search requests */
if ( sfile ) {
snum = get_search_filters( sfile, sreqs, sattrs, sbase );