summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2013-09-25 17:09:58 -0700
committerStefan Metzmacher <metze@samba.org>2013-10-10 08:35:30 +0200
commit6da2dcd17ee46d339d7d80df3dccd456703e7fe2 (patch)
treea8adf5c37ff0f3b652639b0e58223cf59091a36f /source4/dsdb
parentd2ff474766ebb104309bf1e801c54ce0f8ea0a64 (diff)
downloadsamba-6da2dcd17ee46d339d7d80df3dccd456703e7fe2.tar.gz
samba-6da2dcd17ee46d339d7d80df3dccd456703e7fe2.tar.bz2
samba-6da2dcd17ee46d339d7d80df3dccd456703e7fe2.zip
dsdb: Provide a clearer error when we fail to store the sequence number in metadata.tdb
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/samdb/ldb_modules/partition_metadata.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/partition_metadata.c b/source4/dsdb/samdb/ldb_modules/partition_metadata.c
index c67d6cf18f..db1815a450 100644
--- a/source4/dsdb/samdb/ldb_modules/partition_metadata.c
+++ b/source4/dsdb/samdb/ldb_modules/partition_metadata.c
@@ -129,9 +129,13 @@ static int partition_metadata_set_uint64(struct ldb_module *module,
}
if (tdb_store(tdb, tdb_key, tdb_data, tdb_flag) != 0) {
+ int ret;
+ char *error_string = talloc_asprintf(tmp_ctx, "%s: tdb_store of key %s failed: %s",
+ tdb_name(tdb), key, tdb_errorstr(tdb));
+ ret = ldb_module_error(module, LDB_ERR_OPERATIONS_ERROR,
+ error_string);
talloc_free(tmp_ctx);
- return ldb_module_error(module, LDB_ERR_OPERATIONS_ERROR,
- tdb_errorstr(tdb));
+ return ret;
}
talloc_free(tmp_ctx);
@@ -242,9 +246,11 @@ static int partition_metadata_open(struct ldb_module *module, bool create)
if (data->metadata->db == NULL) {
talloc_free(tmp_ctx);
if (create) {
- ldb_debug(ldb, LDB_DEBUG_ERROR,
- "partition_metadata: Unable to create %s",
- filename);
+ ldb_asprintf_errstring(ldb, "partition_metadata: Unable to create %s",
+ filename);
+ } else {
+ ldb_asprintf_errstring(ldb, "partition_metadata: Unable to open %s",
+ filename);
}
return LDB_ERR_OPERATIONS_ERROR;
}
@@ -295,9 +301,16 @@ int partition_metadata_init(struct ldb_module *module)
}
/* metadata.tdb does not exist, create it */
- DEBUG(2, ("partition_metadata: Migrating partition metadata\n"));
+ DEBUG(2, ("partition_metadata: Migrating partition metadata: "
+ "open of metadata.tdb gave: %s\n",
+ ldb_errstring(ldb_module_get_ctx(module))));
ret = partition_metadata_open(module, true);
if (ret != LDB_SUCCESS) {
+ ldb_asprintf_errstring(ldb_module_get_ctx(module),
+ "partition_metadata: "
+ "Migrating partition metadata: "
+ "create of metadata.tdb gave: %s\n",
+ ldb_errstring(ldb_module_get_ctx(module)));
talloc_free(data->metadata);
data->metadata = NULL;
goto end;