diff options
author | Andrew Bartlett <abartlet@samba.org> | 2003-06-21 08:31:18 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2003-06-21 08:31:18 +0000 |
commit | 68f1ca6247f1242e836d989ebdfc139fed866bee (patch) | |
tree | 006280a769c712ce52b342036a6abb432a917cc4 /examples | |
parent | 3f5dc144578cfaa58e227177c780d4261c9242d2 (diff) | |
download | samba-68f1ca6247f1242e836d989ebdfc139fed866bee.tar.gz samba-68f1ca6247f1242e836d989ebdfc139fed866bee.tar.bz2 samba-68f1ca6247f1242e836d989ebdfc139fed866bee.zip |
This patch fixes some issues with idmap_tdb as raised by bug #181
The idea here is to eliminate the need to *set* the 'HWM' (High Water
Mark) in the tdb. Instead, each caller wanting to add an item to the
TDB uses the fact that an insert will *fail* if entry already exists.
More importantly, this means that we don't need to know the value of the
idmap uid/gid values when setting arbitrary entries, which can occur on
an smb.conf without such values specified.
Then all we need to do is loop until we get an id that will insert.
This means that the HWM does not need to be accurate, and we can have
IDs allocates safely above the HWM.
Setting the HWM to an arbitrary value was racy in the past - now we
don't even do it.
This patch also adds paranoia in reading the tdb - both the entry, and
it's reverse entry must be present. This means that we don't need to
'clean up' after an abnormal failure (which would probably fail too),
instead we rely on readers to ignore the half-completed entry. The way
this is done will allow SIDs to then allocated an ID when things are
normal again.
Andrew Bartlett
(This used to be commit 74709e159cdcd4dbcf138428a85067b38c4ebe64)
Diffstat (limited to 'examples')
0 files changed, 0 insertions, 0 deletions