From dda94fdf96e9a2ec77e98ed6304ffb94252e4c7c Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 14 Sep 2006 09:44:48 +0000 Subject: r18508: A query for the LDAP schema can never be done anonymously against AD. Guenther (This used to be commit 8bb6e82f02044a715dbeee020bcc4a01a83c4a64) --- source3/libads/ldap_schema.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source3/libads') diff --git a/source3/libads/ldap_schema.c b/source3/libads/ldap_schema.c index 30d0cb2c0d..da8b168c21 100644 --- a/source3/libads/ldap_schema.c +++ b/source3/libads/ldap_schema.c @@ -181,7 +181,7 @@ static ADS_STATUS ads_schema_path(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, char **s * Check for "Services for Unix" or rfc2307 Schema and load some attributes into the ADS_STRUCT * @param ads connection to ads server * @param enum mapping type - * @return BOOL status of search (False if one or more attributes couldn't be + * @return ADS_STATUS status of search (False if one or more attributes couldn't be * found in Active Directory) **/ ADS_STATUS ads_check_posix_schema_mapping(ADS_STRUCT *ads, enum wb_posix_mapping map_type) @@ -191,7 +191,6 @@ ADS_STATUS ads_check_posix_schema_mapping(ADS_STRUCT *ads, enum wb_posix_mapping char **oids_out, **names_out; size_t num_names; char *schema_path = NULL; - ADS_STRUCT *ads_s = ads; int i; const char *oids_sfu[] = { ADS_ATTR_SFU_UIDNUMBER_OID, @@ -236,22 +235,6 @@ ADS_STATUS ads_check_posix_schema_mapping(ADS_STRUCT *ads, enum wb_posix_mapping return ADS_ERROR(LDAP_NO_MEMORY); } - /* establish a new ldap tcp session if necessary */ - - if (!ads->ld) { - if ((ads_s = ads_init(ads->server.realm, ads->server.workgroup, - ads->server.ldap_server)) == NULL) { - status = ADS_ERROR(LDAP_SERVER_DOWN); - goto done; - } - - ads_s->auth.flags = ADS_AUTH_ANON_BIND; - status = ads_connect(ads_s); - if (!ADS_ERR_OK(status)) { - goto done; - } - } - status = ads_schema_path(ads, ctx, &schema_path); if (!ADS_ERR_OK(status)) { DEBUG(3,("ads_check_posix_mapping: Unable to retrieve schema DN!\n")); @@ -321,10 +304,6 @@ ADS_STATUS ads_check_posix_schema_mapping(ADS_STRUCT *ads, enum wb_posix_mapping ads->schema.map_type = map_type; done: - /* free any temporary ads connections */ - if (ads_s != ads) { - ads_destroy(&ads_s); - } if (ctx) { talloc_destroy(ctx); } -- cgit