summaryrefslogtreecommitdiff
path: root/source3/winbindd/idmap.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-08-07 02:03:22 +0200
committerMichael Adam <obnox@samba.org>2008-08-13 11:54:08 +0200
commit620d87318381a417e3f0843e8cb5f0257ebf9873 (patch)
treed5a6125c1d0864e78c46c1992443e062d16edbfc /source3/winbindd/idmap.c
parent286974e35a759455856ad099075a712888f69673 (diff)
downloadsamba-620d87318381a417e3f0843e8cb5f0257ebf9873.tar.gz
samba-620d87318381a417e3f0843e8cb5f0257ebf9873.tar.bz2
samba-620d87318381a417e3f0843e8cb5f0257ebf9873.zip
idmap tdb2: fix inconsistent mappings by checking for race and retrying to fetch mapping.
Michael (This used to be commit cb4c74c9c206e5a445ca636fa6562ce721ea5839)
Diffstat (limited to 'source3/winbindd/idmap.c')
-rw-r--r--source3/winbindd/idmap.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/winbindd/idmap.c b/source3/winbindd/idmap.c
index c23919fb18..2962fe6c1c 100644
--- a/source3/winbindd/idmap.c
+++ b/source3/winbindd/idmap.c
@@ -705,6 +705,15 @@ NTSTATUS idmap_new_mapping(const struct dom_sid *psid, enum id_type type,
status = dom->methods->set_mapping(dom, &map);
+ if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_COLLISION)) {
+ struct id_map *ids[2];
+ DEBUG(5, ("Mapping for %s exists - retrying to map sid\n",
+ sid_string_dbg(map.sid)));
+ ids[0] = &map;
+ ids[1] = NULL;
+ status = dom->methods->sids_to_unixids(dom, ids);
+ }
+
if (!NT_STATUS_IS_OK(status)) {
DEBUG(3, ("Could not store the new mapping: %s\n",
nt_errstr(status)));