autorid: make the checks for bumping num_mapped identical for alloc and rid case
authorMichael Adam <obnox@samba.org>
Fri, 11 Apr 2014 16:25:44 +0000 (18:25 +0200)
committerMichael Adam <obnox@samba.org>
Fri, 25 Apr 2014 13:35:09 +0000 (15:35 +0200)
in idmap_autorid_sids_to_unixids()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
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++;
                }
        }