dsdb: Provide proper errors when dsdb_schema_set_indices_and_attributes fails
authorAndrew Bartlett <abartlet@samba.org>
Fri, 9 Jun 2017 00:06:37 +0000 (12:06 +1200)
committerGarming Sam <garming@samba.org>
Wed, 14 Jun 2017 23:24:25 +0000 (01:24 +0200)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
source4/dsdb/schema/schema_set.c

index fd48d279af24fc5bdecc6933169c8da272584d2b..977c9e339b61983bfcb50ba52598284dd1035508 100644 (file)
@@ -184,6 +184,8 @@ int dsdb_schema_set_indices_and_attributes(struct ldb_context *ldb,
                ret = LDB_SUCCESS;
        }
        if (ret != LDB_SUCCESS) {
+               DBG_ERR("Failed to set schema into @ATTRIBUTES: %s\n",
+                       ldb_errstring(ldb));
                talloc_free(mem_ctx);
                return ret;
        }
@@ -216,6 +218,12 @@ int dsdb_schema_set_indices_and_attributes(struct ldb_context *ldb,
                /* We might be on a read-only DB */
                ret = LDB_SUCCESS;
        }
+
+       if (ret != LDB_SUCCESS) {
+               DBG_ERR("Failed to set schema into @INDEXLIST: %s\n",
+                       ldb_errstring(ldb));
+       }
+
        talloc_free(mem_ctx);
        return ret;