summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-07-29 14:56:32 +0200
committerMichael Adam <obnox@samba.org>2009-07-29 16:26:27 +0200
commit3acef0993501468f3ef807e76b56aa296f8a87d0 (patch)
tree9c329df406539eafc16ee2d0252f28c6fe00ef09
parente46e5d7d0871e203ea8c4bb92a7b27e6cafce77d (diff)
downloadsamba-3acef0993501468f3ef807e76b56aa296f8a87d0.tar.gz
samba-3acef0993501468f3ef807e76b56aa296f8a87d0.tar.bz2
samba-3acef0993501468f3ef807e76b56aa296f8a87d0.zip
s3:winbind: use transaction store in idmap_tdb_set_hwm() to store new hwm.
Btw, the previous code must have failed to warn when exceeding the high_hwm, because it overwrote hwm with the return value of the dbwrap_store_uint32(), which does not return the hwm but 0 or -1, depending on success. Michael
-rw-r--r--source3/winbindd/idmap_tdb.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source3/winbindd/idmap_tdb.c b/source3/winbindd/idmap_tdb.c
index 94d253e6e6..189b088809 100644
--- a/source3/winbindd/idmap_tdb.c
+++ b/source3/winbindd/idmap_tdb.c
@@ -531,6 +531,7 @@ static NTSTATUS idmap_tdb_set_hwm(struct unixid *xid)
const char *hwmtype;
uint32_t hwm;
uint32_t high_hwm;
+ NTSTATUS ret;
/* Get current high water mark */
switch (xid->type) {
@@ -553,17 +554,15 @@ static NTSTATUS idmap_tdb_set_hwm(struct unixid *xid)
hwm = xid->id;
- if ((hwm = dbwrap_store_uint32(idmap_alloc_db, hwmkey, hwm)) == -1) {
- return NT_STATUS_INTERNAL_DB_ERROR;
- }
-
/* Warn if it is out of range */
if (hwm >= high_hwm) {
DEBUG(0, ("Warning: %s range full!! (max: %lu)\n",
hwmtype, (unsigned long)high_hwm));
}
- return NT_STATUS_OK;
+ ret = dbwrap_trans_store_uint32(idmap_alloc_db, hwmkey, hwm);
+
+ return ret;
}
/**********************************