mirror of
https://github.com/samba-team/samba.git
synced 2025-03-09 08:58:35 +03:00
ldb_tdb: Map TDB error codes into LDB error codes in ltdb_lock_read()
The ltdb_lock_read() routine did not return an LDB error code, but -1. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13033 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
This commit is contained in:
parent
24996c60aa
commit
75e88e40a2
@ -98,15 +98,26 @@ int ltdb_lock_read(struct ldb_module *module)
|
||||
{
|
||||
void *data = ldb_module_get_private(module);
|
||||
struct ltdb_private *ltdb = talloc_get_type(data, struct ltdb_private);
|
||||
int ret = 0;
|
||||
int tdb_ret = 0;
|
||||
int ret;
|
||||
|
||||
if (ltdb->in_transaction == 0 &&
|
||||
ltdb->read_lock_count == 0) {
|
||||
ret = tdb_lockall_read(ltdb->tdb);
|
||||
tdb_ret = tdb_lockall_read(ltdb->tdb);
|
||||
}
|
||||
if (ret == 0) {
|
||||
if (tdb_ret == 0) {
|
||||
ltdb->read_lock_count++;
|
||||
return LDB_SUCCESS;
|
||||
}
|
||||
ret = ltdb_err_map(tdb_error(ltdb->tdb));
|
||||
if (ret == LDB_SUCCESS) {
|
||||
ret = LDB_ERR_OPERATIONS_ERROR;
|
||||
}
|
||||
ldb_debug_set(ldb_module_get_ctx(module),
|
||||
LDB_DEBUG_FATAL,
|
||||
"Failure during ltdb_lock_read(): %s -> %s",
|
||||
tdb_errorstr(ltdb->tdb),
|
||||
ldb_strerror(ret));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user