s3:idmap_ldap: create mappings for unmapped sids in idmap_ldap_sids_to_unixids()
authorMichael Adam <obnox@samba.org>
Thu, 17 Jun 2010 19:55:02 +0000 (21:55 +0200)
committerMichael Adam <obnox@samba.org>
Sat, 14 Aug 2010 00:10:54 +0000 (02:10 +0200)
source3/winbindd/idmap_ldap.c

index be1169d757c7221b687a39ca8debebbc2805868d..13295a620ff9039136d9d70d3fd71cc106d3e96b 100644 (file)
@@ -1256,14 +1256,23 @@ again:
                goto again;
        }
 
-       ret = NT_STATUS_OK;
-
-       /* mark all unknwon/expired ones as unmapped */
+       /*
+        *  try to create new mappings for unmapped sids
+        */
        for (i = 0; ids[i]; i++) {
-               if (ids[i]->status != ID_MAPPED)
+               if (ids[i]->status != ID_MAPPED) {
                        ids[i]->status = ID_UNMAPPED;
+                       if (ids[i]->sid != NULL) {
+                               ret = idmap_ldap_new_mapping(dom, ids[i]);
+                               if (!NT_STATUS_IS_OK(ret)) {
+                                       goto done;
+                               }
+                       }
+               }
        }
 
+       ret = NT_STATUS_OK;
+
 done:
        talloc_free(memctx);
        return ret;