35b4b21 KRB5: Do not switch_creds() if already the specified user

Authored and Committed by jhrozek 9 years ago
    KRB5: Do not switch_creds() if already the specified user
    
    The code didn't have to handle this case previously as sssd_be was always
    running as root and switching to the ccache as the user logging in.
    
    Also handle NULL creds on restore_creds() in case there was no switch.
    One less if-condition and fewer indentation levels.
    
    Related:
    https://fedorahosted.org/sssd/ticket/2370
    
    Reviewed-by: Sumit Bose <sbose@redhat.com>
    Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
    
        
file modified
+21 -8