Date: Sat Jun 21 08:31:19 2003 Author: abartlet Update of /home/cvs/samba/source/sam In directory dp.samba.org:/tmp/cvs-serv18905/sam
Modified Files: Tag: SAMBA_3_0 idmap_tdb.c Log Message: 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 Revisions: idmap_tdb.c 1.12.2.10 => 1.12.2.11 http://www.samba.org/cgi-bin/cvsweb/samba/source/sam/idmap_tdb.c.diff?r1=1.12.2.10&r2=1.12.2.11