+/* $OpenLDAP$ */
+/*
+ * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
#include "portable.h"
#include <stdio.h>
-#include <stdlib.h>
-#include <ac/string.h>
+#include <ac/stdlib.h>
+
#include <ac/ctype.h>
+#include <ac/param.h>
#include <ac/socket.h>
+#include <ac/string.h>
#include <ac/unistd.h>
#include <ac/wait.h>
-#include <sys/param.h>
-
-#include "lber.h"
-#include "ldap.h"
+#include <ldap.h>
#define LOOPS 100
{
fprintf( stderr, "usage: %s [-h <host>] -p port -e <entry> [-l <loops>]\n",
name );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
int
main( int argc, char **argv )
{
- int i, j;
+ int i;
char *host = "localhost";
int port = -1;
char *entry = NULL;
fprintf( stderr, "%s: invalid EMPTY entry DN.\n",
argv[0] );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
do_read( host, port, entry, ( 4 * loops ));
- exit( 0 );
+ exit( EXIT_SUCCESS );
}
{
LDAP *ld;
int i;
- char *attrs[] = { "cn", "sn", NULL };
- char *filter = "(objectclass=*)";
+ char *attrs[] = { "1.1", NULL };
pid_t pid = getpid();
if (( ld = ldap_init( host, port )) == NULL ) {
perror( "ldap_init" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
if ( ldap_bind_s( ld, NULL, NULL, LDAP_AUTH_SIMPLE ) != LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_bind" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
int rc;
if (( rc = ldap_search_s( ld, entry, LDAP_SCOPE_BASE,
- filter, attrs, 0, &res )) != LDAP_SUCCESS ) {
+ NULL, attrs, 1, &res )) != LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_read" );
if ( rc != LDAP_NO_SUCH_OBJECT ) break;