e4264a9 ipa-kdb: update trust information in all workers

1 file Authored by sbose 6 years ago, Committed by cheimes 6 years ago,
    ipa-kdb: update trust information in all workers
    
    Currently there is already code to make sure that after trust is established an
    AS-REQ of the local HTTP principal causes a refresh of the internal structures
    holding the information about the trusted domains.
    
    But this refreshes only the data of the current krb5kdc worker process on the
    local host. Other workers and the KDCs on other hosts will update the data
    eventually when a request with a principal from a trusted realm is handled.
    
    During this phase, which might last quite long if remote principals are only
    handled rarely, TGTs for local principals might or might not contain a PAC
    because the decision if a PAC should be added or not is based on the
    information about trusted domains. Since the PAC is needed to access services
    on the AD side this access might fail intermittently depending which worker
    process on which host is handling the request. This might e.g. affect SSSD
    running on the IPA server with two-way trust.
    
    To fix this this patch calls ipadb_reinit_mspac() whenever a PAC is needed but
    without the 'force' flag so that the refresh will only happen if it wasn't
    called recently (currently not more often than once a minute).
    
    An alternative might be to do the refresh only when processing cross-realm TGT
    requests. But this would be already too late because the local principal asking
    for a cross-realm ticket would not have a PAC and hence the first attempt will
    still fail due to the missing PAC. And injecting the PAC in the cross-realm TGT
    while there is none in the requesting ticket does not sound right.
    
    Related to https://pagure.io/freeipa/issue/7351
    
    Reviewed-By: Simo Sorce <ssorce@redhat.com>
    
        
file modified
+20 -13