0216bfe KCM: Fill empty cache, do not initialize a new one

1 file Authored by jhrozek 4 years ago, Committed by pbrezina 4 years ago,
    KCM: Fill empty cache, do not initialize a new one
    
    Related:
    https://pagure.io/SSSD/sssd/issue/4017
    
    openssh uses this sequence of calls:
        gen_new()
        switch()
        initialize()
    
    What happened before was that if there was already some cache, gen_new
    would create a new empty cache, then switch would set it as the default.
    But then, during the initialize call, the cache that used to be the
    default was deleted, another one created and used as the default. This
    meant. Afterwards, KCM would store the credentials in the previous
    cache, which would no longer be the default.
    
    The logic behind was that KCM didn't anticipate the client generating
    the new and setting the default on its own.
    
    Reviewed-by: Michal Židek <mzidek@redhat.com>