s3:winbind:idmap_ad - make failure to get attrnames for schema mode fatal
authorAndrew <awalker@ixsystems.com>
Tue, 30 Jun 2020 10:54:06 +0000 (06:54 -0400)
committerKarolin Seeger <kseeger@samba.org>
Thu, 9 Jul 2020 09:56:19 +0000 (09:56 +0000)
Add check for failure to resolve the OID array for the schema mode into
names.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14425

Signed-off-by: Andrew <awalker@ixsystems.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit b5b801026edd3a8fd8d0ba1752e891453cf675c9)

source3/winbindd/idmap_ad.c

index a93c61f54d1a16d434494f29b2d219f0d9ebe627..6d879cdf4d7b667746faa603e2922f0562d54774 100644 (file)
@@ -162,6 +162,14 @@ static TLDAPRC get_attrnames_by_oids(struct tldap_context *ld,
        }
 
        TALLOC_FREE(msgs);
+       for (i=0; i<num_oids; i++) {
+               if (names[i] == NULL) {
+                       DBG_ERR("Failed to retrieve schema name for "
+                               "oid [%s]. Schema mode is incorrect "
+                               "for this domain.\n", oids[i]);
+                       return TLDAP_FILTER_ERROR;
+               }
+       }
 
        return TLDAP_SUCCESS;
 }