idmap_autorid: Fix a race condition when acquiring ranges
authorVolker Lendecke <vl@samba.org>
Fri, 2 Dec 2016 15:37:49 +0000 (15:37 +0000)
committerVolker Lendecke <vl@samba.org>
Fri, 16 Dec 2016 16:38:20 +0000 (17:38 +0100)
commit9c6c2ad26d1936f8a731b18198b47e35e4938d96
treed5476bd6cfedb8b97473662dab5b324c7bef2d9d
parenta04cec5c624e4486b5ff56b064443ec3dbdfd181
idmap_autorid: Fix a race condition when acquiring ranges

Here we are in a transaction to create a range, but we already found
one to exist. We need to return the information about this range to the
caller, just as we do when actually allocating the range. This does not
hit us with current code, as we just have one idmap child. However, if
we parallelize that, two children might have found a domain to not exist
and call idmap_autorid_acquire_range simultaneously. One will create
the range, the other one will find it to already exist. The second child
will also have to pass the info up.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/winbindd/idmap_autorid_tdb.c