s4-libnet: Improve debugging of libnet_BecomeDC LDAP errors
[samba.git] / source4 / dsdb / common / util.c
index 251e17759b4f27a9add07c0a4da53ec40b4322e0..fd54e4adb94d9af4f1b33951e6960df372430620 100644 (file)
@@ -1590,6 +1590,8 @@ int samdb_reference_dn(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, struct ldb_
 
        ret = dsdb_search(ldb, mem_ctx, &res, base, LDB_SCOPE_BASE, attrs, DSDB_SEARCH_ONE_ONLY, NULL);
        if (ret != LDB_SUCCESS) {
+               ldb_asprintf_errstring(ldb, "Cannot find DN %s to get attribute %s for reference dn: %s",
+                                      ldb_dn_get_linearized(base), attribute, ldb_errstring(ldb));
                return ret;
        }