version 1.18.2.3, 2006/08/17 23:50:33
|
version 1.18.2.4, 2006/10/19 20:06:57
|
Line 1
|
Line 1
|
/* $OpenLDAP: pkg/ldap/tests/progs/slapd-bind.c,v 1.18.2.2 2006/05/15 17:04:45 kurt Exp $ */ |
/* $OpenLDAP: pkg/ldap/tests/progs/slapd-bind.c,v 1.18.2.3 2006/08/17 23:50:33 kurt Exp $ */ |
/* This work is part of OpenLDAP Software <http://www.openldap.org/>. |
/* This work is part of OpenLDAP Software <http://www.openldap.org/>. |
* |
* |
* Copyright 1999-2006 The OpenLDAP Foundation. |
* Copyright 1999-2006 The OpenLDAP Foundation. |
Line 288 do_base( char *uri, char *dn, struct ber
|
Line 288 do_base( char *uri, char *dn, struct ber
|
int version = LDAP_VERSION3; |
int version = LDAP_VERSION3; |
char *nullstr = ""; |
char *nullstr = ""; |
|
|
srand(pid); |
srand( pid ); |
|
|
ldap_initialize( &ld, uri ); |
ldap_initialize( &ld, uri ); |
if ( ld == NULL ) { |
if ( ld == NULL ) { |
Line 397 novals:;
|
Line 397 novals:;
|
|
|
/* Ok, got list of DNs, now start binding to each */ |
/* Ok, got list of DNs, now start binding to each */ |
for ( i = 0; i < maxloop; i++ ) { |
for ( i = 0; i < maxloop; i++ ) { |
int j, k; |
int j; |
struct berval cred = { 0, NULL }; |
struct berval cred = { 0, NULL }; |
|
|
for ( j = 0, k = 0; k < ndns; k++) { |
|
j = rand() % ndns; |
#if 0 /* use high-order bits for better randomness (Numerical Recipes in "C") */ |
} |
j = rand() % ndns; |
|
#endif |
|
j = ((double)ndns)*rand()/(RAND_MAX + 1.0); |
|
|
if ( creds && !BER_BVISEMPTY( &creds[j] ) ) { |
if ( creds && !BER_BVISEMPTY( &creds[j] ) ) { |
cred = creds[j]; |
cred = creds[j]; |
} |
} |
|
|
if ( do_bind( uri, dns[j], &cred, 1, force, chaserefs, noinit, &ld ) |
if ( do_bind( uri, dns[j], &cred, 1, force, chaserefs, noinit, &ld ) |
&& !force ) |
&& !force ) |
{ |
{ |