break;
case 'F':
- force = 1;
+ force++;
break;
default:
do_bind( char *uri, char *dn, struct berval *pass, int maxloop, int force )
{
LDAP *ld = NULL;
- int i, rc = -1;
+ int i, first = 1, rc = -1;
pid_t pid = getpid();
if ( maxloop > 1 )
}
rc = ldap_sasl_bind_s( ld, dn, LDAP_SASL_SIMPLE, pass, NULL, NULL, NULL );
- if ( rc != LDAP_SUCCESS ) {
+ switch ( rc ) {
+ case LDAP_SUCCESS:
+ break;
+
+ case LDAP_INVALID_CREDENTIALS:
+ /* don't log: it's intended */
+ if ( force >= 2 ) {
+ if ( !first ) {
+ break;
+ }
+ first = 0;
+ }
+ /* fallthru */
+
+ default:
tester_ldap_error( ld, "ldap_sasl_bind_s" );
}
ldap_unbind_ext( ld, NULL, NULL );
int banum;
char bcmd[MAXPATHLEN];
+ char *friendlyOpt = NULL;
+
tester_init( "slapd-tester" );
while ( (i = getopt( argc, argv, "D:d:FH:h:j:l:P:p:r:t:w:" )) != EOF ) {
bnum = get_search_filters( bfile, bcreds, breqs );
}
+ /* setup friendly option */
+
+ switch ( friendly ) {
+ case 0:
+ break;
+
+ case 1:
+ friendlyOpt = "-F";
+ break;
+
+ default:
+ /* NOTE: right now we don't need it more than twice */
+ case 2:
+ friendlyOpt = "-FF";
+ break;
+ }
+
/*
* generate the search clients
*/
margs[manum++] = "-t";
margs[manum++] = delay;
if ( friendly ) {
- margs[manum++] = "-F";
+ margs[manum++] = friendlyOpt;
}
margs[manum++] = "-e";
margs[manum++] = NULL; /* will hold the modrdn entry */
modargs[modanum++] = "-t";
modargs[modanum++] = delay;
if ( friendly ) {
- modargs[modanum++] = "-F";
+ modargs[modanum++] = friendlyOpt;
}
modargs[modanum++] = "-e";
modargs[modanum++] = NULL; /* will hold the modify entry */
aargs[aanum++] = "-t";
aargs[aanum++] = delay;
if ( friendly ) {
- aargs[aanum++] = "-F";
+ aargs[aanum++] = friendlyOpt;
}
aargs[aanum++] = "-f";
aargs[aanum++] = NULL; /* will hold the add data file */
bargs[banum++] = delay;
#endif
if ( friendly ) {
- bargs[banum++] = "-F";
+ bargs[banum++] = friendlyOpt;
}
bargs[banum++] = "-D";
bargs[banum++] = NULL;