From 3acef0993501468f3ef807e76b56aa296f8a87d0 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 29 Jul 2009 14:56:32 +0200 Subject: 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 --- source3/winbindd/idmap_tdb.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'source3/winbindd') 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; } /********************************** -- cgit