autorid: make the checks for bumping num_mapped identical for alloc and rid case
[obnox/samba/samba-obnox.git] / source3 / winbindd / idmap_autorid.c
index 0bdc96dd477a90c64bc93549d3493fdec0af9a0f..b66caec90226175e3073875f5f344c43824fcc98 100644 (file)
@@ -465,7 +465,7 @@ static NTSTATUS idmap_autorid_sids_to_unixids(struct idmap_domain *dom,
                                goto failure;
                        }
 
-                       if (ids[i]->status == ID_MAPPED) {
+                       if (NT_STATUS_IS_OK(ret) && ids[i]->status == ID_MAPPED) {
                                num_mapped++;
                        }
 
@@ -524,7 +524,7 @@ static NTSTATUS idmap_autorid_sids_to_unixids(struct idmap_domain *dom,
                        goto failure;
                }
 
-               if (NT_STATUS_IS_OK(ret)) {
+               if (NT_STATUS_IS_OK(ret) && ids[i]->status == ID_MAPPED) {
                        num_mapped++;
                }
        }