s4:ldb Don't sleep(100) in this error case, but debug the LDIF
[ira/wip.git] / source4 / lib / ldb / ldb_tdb / ldb_index.c
index 1daa4500f89b0c6859232d06f27005c0c41104a5..7db22de09783bf851a2c5e66a32c6737b2c908a2 100644 (file)
@@ -1407,14 +1407,14 @@ int ltdb_index_del_value(struct ldb_module *module, const char *dn,
        i = ldb_msg_find_idx(msg, dn, &j, LTDB_IDX);
        if (i == -1) {
                struct ldb_ldif ldif;
-
-               ldb_debug(ldb, LDB_DEBUG_ERROR,
-                               "ERROR: dn %s not found in %s", dn,
-                               ldb_dn_get_linearized(dn_key));
+               char *ldif_string;
                ldif.changetype = LDB_CHANGETYPE_NONE;
                ldif.msg = msg;
-               ldb_ldif_write_file(ldb, stdout, &ldif);
-               sleep(100);
+               ldif_string = ldb_ldif_write_string(ldb, NULL, &ldif);
+               ldb_debug(ldb, LDB_DEBUG_ERROR,
+                         "ERROR: dn %s not found in %s", dn,
+                         ldif_string);
+               talloc_free(ldif_string);
                /* it ain't there. hmmm */
                talloc_free(dn_key);
                return LDB_SUCCESS;