2546ef6 Prevent set_directive from clobbering other keys

3 files Authored by ftweedal 6 years ago, Committed by cheimes 6 years ago,
    Prevent set_directive from clobbering other keys
    
    `set_directive` only looks for a prefix of the line matching the
    given directive (key).  If a directive is encountered for which the
    given key is prefix, it will be vanquished.
    
    This occurs in the case of `{ca,kra}.sslserver.cert[req]`; the
    `cert` directive gets updated after certificate renewal, and the
    `certreq` directive gets clobbered.  This can cause failures later
    on during KRA installation, and possibly cloning.
    
    Match the whole directive to avoid this issue.
    
    Fixes: https://pagure.io/freeipa/issue/7288
    Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>