5a4df83 sss_client: Fix "struct sss_cli_mc_ctx" reinitialize-on-errors

1 file Authored by nalin 9 years ago, Committed by jhrozek 9 years ago,
    sss_client: Fix "struct sss_cli_mc_ctx" reinitialize-on-errors
    
    When we have difficulty setting up an sss_cli_mc_ctx structure, we try
    to clean things up so that we'll be ready to try again the next time
    we're called.
    
    Part of that is closing the descriptor of the file if we've opened it
    and using memset() to clear the structure.
    
    Now that sss_nss_mc_get_ctx() does its work in two phases, and each one
    may end up doing the cleanup, each needs to be careful to reset the
    descriptor field so that the new value provided by memset() (0) isn't
    mistakenly treated as a file which should be closed by the other.
    
    Resolves:
    https://fedorahosted.org/sssd/ticket/2409
    
    Reviewed-by: Simo Sorce <simo@redhat.com>