c4ddb9c AD SUBDOMAINS: Fix search bases for child domains

2 files Authored by mzidek 6 years ago, Committed by lslebodn 6 years ago,
    AD SUBDOMAINS: Fix search bases for child domains
    
    When using direct AD integration, child domains did not respect
    the sssd.conf configuration of search bases.
    
    There were few issues all of which are fixed in this small
    patch.
    
    First problem was that the sdap domain list was not properly
    inherited from the parent in the child domains and the children
    always created their own sdap domains lists that were disconnected
    from the parent context and never used.
    
    Second issue was that the child domain did not call the function
    to reinit the search bases after the sdap_domain was added to the
    list of sdap domains. This caused that child domains always used
    automatically detected search bases and never used the configured
    ones even though they were properly read into the ID options
    context attached to the subdomain.
    
    Also there has been an issue that the sdap search bases
    were rewritten by the new child domain initialization
    (this only happened with more than one child domain)
    because the sdap domain list was 'updated' every time
    a new child domain was initialized, which caused that
    only the main domain and the last child domain had proper
    search bases, the others only the auto-discovered ones
    (because they were overwritten with the 'update').
    
    Resolves:
    https://pagure.io/SSSD/sssd/issue/3397
    
    Reviewed-by: Sumit Bose <sbose@redhat.com>