Fix the mess with ldb includes.
[metze/samba/wip.git] / source4 / lib / ldb / common / ldb_ldif.c
index 69490e670bf98be466d2061f098e08534c3a6b92..400fb352ff4aba05ef06d976f4034b81cf8e9a10 100644 (file)
@@ -35,7 +35,7 @@
   see RFC2849 for the LDIF format definition
 */
 
-#include "ldb_includes.h"
+#include "ldb_private.h"
 #include "system/locale.h"
 
 /*
@@ -278,13 +278,15 @@ int ldb_ldif_write(struct ldb_context *ldb,
        TALLOC_CTX *mem_ctx;
        unsigned int i, j;
        int total=0, ret;
+       char *p;
        const struct ldb_message *msg;
 
        mem_ctx = talloc_named_const(NULL, 0, "ldb_ldif_write");
 
        msg = ldif->msg;
-
-       ret = fprintf_fn(private_data, "dn: %s\n", ldb_dn_get_linearized(msg->dn));
+       p = ldb_dn_get_extended_linearized(mem_ctx, msg->dn, 1);
+       ret = fprintf_fn(private_data, "dn: %s\n", p);
+       talloc_free(p);
        CHECK_RET;
 
        if (ldif->changetype != LDB_CHANGETYPE_NONE) {