d0eae05 KCM: Create an empty ccache on switch to a non-existing one

Authored and Committed by jhrozek 5 years ago
    KCM: Create an empty ccache on switch to a non-existing one
    
    Related:
    https://pagure.io/SSSD/sssd/issue/3873
    
    We need to make it possible to create an internal ccache representation
    without passing in a principal. The principal is only assigned to the
    ccache with krb5_cc_initialize(), but some programs like openssh use the
    following sequence of calls:
        cc = krb5_cc_new_unique
        krb5_cc_switch(cc)
        krb5_cc_initialize(cc, principal)
    
    Since switch changes the default ccache, we create a 'dummy' ccache with
    krb5_cc_switch() and then the initialize call just fills in the details.
    
    Reviewed-by: Simo Sorce <simo@redhat.com>
    Reviewed-by: Michal Židek <mzidek@redhat.com>
    
        
file modified
+118 -15