static void
do_addel( char *uri, char *host, int port, char *manager, char *passwd,
- char *dn, LDAPMod **attrs, int maxloop, int maxretries, int delay );
+ char *dn, LDAPMod **attrs, int maxloop, int maxretries, int delay,
+ int friendly );
static void
usage( char *name )
int loops = LOOPS;
int retries = RETRIES;
int delay = 0;
+ int friendly = 0;
LDAPMod **attrs = NULL;
- while ( (i = getopt( argc, argv, "H:h:p:D:w:f:l:r:t:" )) != EOF ) {
+ while ( (i = getopt( argc, argv, "FH:h:p:D:w:f:l:r:t:" )) != EOF ) {
switch( i ) {
+ case 'F':
+ friendly++;
+ break;
+
case 'H': /* the server's URI */
uri = strdup( optarg );
break;
}
do_addel( uri, host, port, manager, passwd, entry, attrs,
- loops, retries, delay );
+ loops, retries, delay, friendly );
exit( EXIT_SUCCESS );
}
LDAPMod **attrs,
int maxloop,
int maxretries,
- int delay
+ int delay,
+ int friendly
)
{
LDAP *ld = NULL;
/* NOTE: this likely means
* the delete failed
* during the previous round... */
+ if ( !friendly ) {
+ goto done;
+ }
break;
case LDAP_BUSY:
/* NOTE: this likely means
* the add failed
* during the previous round... */
+ if ( !friendly ) {
+ goto done;
+ }
break;
case LDAP_BUSY:
static void
do_modify( char *uri, char *host, int port, char *manager, char *passwd,
char *entry, char *attr, char *value, int maxloop,
- int maxretries, int delay );
+ int maxretries, int delay, int friendly );
static void
int loops = LOOPS;
int retries = RETRIES;
int delay = 0;
+ int friendly = 0;
- while ( (i = getopt( argc, argv, "H:h:p:D:w:e:a:l:r:t:" )) != EOF ) {
+ while ( (i = getopt( argc, argv, "FH:h:p:D:w:e:a:l:r:t:" )) != EOF ) {
switch( i ) {
+ case 'F':
+ friendly++;
+ break;
+
case 'H': /* the server uri */
uri = strdup( optarg );
break;
value++;
do_modify( uri, host, port, manager, passwd, entry, ava, value,
- loops, retries, delay );
+ loops, retries, delay, friendly );
exit( EXIT_SUCCESS );
}
static void
do_modify( char *uri, char *host, int port, char *manager,
char *passwd, char *entry, char* attr, char* value,
- int maxloop, int maxretries, int delay )
+ int maxloop, int maxretries, int delay, int friendly )
{
LDAP *ld = NULL;
int i = 0, do_retry = maxretries;
/* NOTE: this likely means
* the second modify failed
* during the previous round... */
+ if ( !friendly ) {
+ goto done;
+ }
break;
case LDAP_BUSY:
/* NOTE: this likely means
* the first modify failed
* during the previous round... */
+ if ( !friendly ) {
+ goto done;
+ }
break;
case LDAP_BUSY:
static void
do_modrdn( char *uri, char *host, int port, char *manager, char *passwd,
- char *entry, int maxloop, int maxretries, int delay );
+ char *entry, int maxloop, int maxretries, int delay,
+ int friendly );
static void
usage( char *name )
int loops = LOOPS;
int retries = RETRIES;
int delay = 0;
+ int friendly = 0;
- while ( (i = getopt( argc, argv, "H:h:p:D:w:e:l:r:t:" )) != EOF ) {
+ while ( (i = getopt( argc, argv, "FH:h:p:D:w:e:l:r:t:" )) != EOF ) {
switch( i ) {
+ case 'F':
+ friendly++;
+ break;
+
case 'H': /* the server uri */
uri = strdup( optarg );
break;
}
- do_modrdn( uri, host, port, manager, passwd, entry, loops, retries, delay );
+ do_modrdn( uri, host, port, manager, passwd, entry,
+ loops, retries, delay, friendly );
exit( EXIT_SUCCESS );
}
static void
do_modrdn( char *uri, char *host, int port, char *manager,
- char *passwd, char *entry, int maxloop, int maxretries, int delay )
+ char *passwd, char *entry, int maxloop, int maxretries, int delay,
+ int friendly )
{
LDAP *ld = NULL;
int i = 0, do_retry = maxretries;
/* NOTE: this likely means
* the second modrdn failed
* during the previous round... */
+ if ( !friendly ) {
+ goto done;
+ }
break;
case LDAP_BUSY:
/* NOTE: this likely means
* the first modrdn failed
* during the previous round... */
+ if ( !friendly ) {
+ goto done;
+ }
break;
case LDAP_BUSY:
"[-j <maxchild>] "
"[-l <loops>] "
"-P <progdir> "
- "[-r <maxretries>]"
- "[-t <delay>]\n",
+ "[-r <maxretries>] "
+ "[-t <delay>] "
+ "[-F]\n",
name );
exit( EXIT_FAILURE );
}
char *modreqs[MAXREQS];
char *moddn[MAXREQS];
int modnum = 0;
+ int friendly = 0;
- while ( (i = getopt( argc, argv, "D:d:H:h:j:l:P:p:r:t:w:" )) != EOF ) {
+ while ( (i = getopt( argc, argv, "D:d:FH:h:j:l:P:p:r:t:w:" )) != EOF ) {
switch( i ) {
case 'D': /* slapd manager */
manager = ArgDup( optarg );
dirname = strdup( optarg );
break;
+ case 'F':
+ friendly++;
+ break;
+
case 'H': /* slapd uri */
uri = strdup( optarg );
break;
margs[manum++] = retries;
margs[manum++] = "-t";
margs[manum++] = delay;
+ if ( friendly ) {
+ margs[manum++] = "-F";
+ }
margs[manum++] = "-e";
margs[manum++] = NULL; /* will hold the modrdn entry */
margs[manum++] = NULL;
modargs[modanum++] = retries;
modargs[modanum++] = "-t";
modargs[modanum++] = delay;
+ if ( friendly ) {
+ modargs[modanum++] = "-F";
+ }
modargs[modanum++] = "-e";
modargs[modanum++] = NULL; /* will hold the modify entry */
modargs[modanum++] = "-a";;
aargs[aanum++] = retries;
aargs[aanum++] = "-t";
aargs[aanum++] = delay;
+ if ( friendly ) {
+ aargs[aanum++] = "-F";
+ }
aargs[aanum++] = "-f";
aargs[aanum++] = NULL; /* will hold the add data file */
aargs[aanum++] = NULL;