]> git.sur5r.net Git - openldap/blobdiff - tests/progs/slapd-addel.c
Merge remote branch 'origin/mdb.master'
[openldap] / tests / progs / slapd-addel.c
index eac2bab56bb30d82cc2de239a874e9acf933fe6d..9445282e910e322763a75ddf6026651e07263679 100644 (file)
@@ -1,7 +1,7 @@
 /* $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"
 
@@ -278,7 +278,10 @@ get_add_entry( char *filename, LDAPMod ***mods )
 
                        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 );
 
                }
 
@@ -424,7 +427,7 @@ retry:;
        }
 
 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 );
 }