/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1999-2006 The OpenLDAP Foundation.
+ * Copyright 1999-2012 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#include <stdio.h>
-#include <ac/stdlib.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 "ac/ctype.h"
+#include "ac/param.h"
+#include "ac/socket.h"
+#include "ac/string.h"
+#include "ac/unistd.h"
+#include "ac/wait.h"
-#include <ldap.h>
-#include <lutil.h>
+#include "ldap.h"
+#include "lutil.h"
#include "slapd-common.h"
tester_init( "slapd-addel", TESTER_ADDEL );
- while ( (i = getopt( argc, argv, "CFH:h:p:D:w:f:l:L:r:t:" )) != EOF ) {
- switch( i ) {
+ while ( ( i = getopt( argc, argv, "CD:Ff:H:h:i:L:l:p:r:t:w:" ) ) != EOF )
+ {
+ switch ( i ) {
case 'C':
chaserefs++;
break;
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 */
if (( nl = strchr( line, '\r' )) || ( nl = strchr( line, '\n' )))
*nl = '\0';
- entry = strdup( line );
+ nl = line;
+ if ( !strncasecmp( nl, "dn: ", 4 ))
+ nl += 4;
+ entry = strdup( nl );
}
{
LDAP *ld = NULL;
int i = 0, do_retry = maxretries;
- pid_t pid = getpid();
int rc = LDAP_SUCCESS;
int version = LDAP_VERSION3;
}
done:;
- fprintf( stderr, " PID=%ld - Add/Delete done (%d).\n", (long) pid, rc );
+ fprintf( stderr, " PID=%ld - Add/Delete done (%d).\n", (long) pid, rc );
ldap_unbind_ext( ld, NULL, NULL );
}