Do not create a new mapping if a domain with an explicit config fails
authorVolker Lendecke <vl@samba.org>
Tue, 29 Jul 2008 07:04:17 +0000 (09:04 +0200)
committerVolker Lendecke <vl@samba.org>
Tue, 12 Aug 2008 09:28:29 +0000 (11:28 +0200)
source/winbindd/idmap_util.c

index 04d12944e2570866c329cb54d05e78a24396fde0..2a6beca5a2a9b3f0b5b68d6947ec208a46dc0812 100644 (file)
@@ -174,6 +174,15 @@ backend:
                goto done;
        }
 
+       if (dom_name[0] != '\0') {
+               /*
+                * We had the task to go to a specific domain which
+                * could not answer our request. Fail.
+                */
+               idmap_cache_set_sid2uid(sid, -1);
+               return NT_STATUS_NONE_MAPPED;
+       }
+
        ret = idmap_new_mapping(sid, ID_TYPE_UID, &map.xid);
 
        if (!NT_STATUS_IS_OK(ret)) {
@@ -236,6 +245,15 @@ backend:
                goto done;
        }
 
+       if (domname[0] != '\0') {
+               /*
+                * We had the task to go to a specific domain which
+                * could not answer our request. Fail.
+                */
+               idmap_cache_set_sid2uid(sid, -1);
+               return NT_STATUS_NONE_MAPPED;
+       }
+
        ret = idmap_new_mapping(sid, ID_TYPE_GID, &map.xid);
 
        if (!NT_STATUS_IS_OK(ret)) {