ipa-client: Check if IPA CA cert is empty

IPA CA file should not be used when file is empty.

Fixes: https://pagure.io/freeipa/issue/9499
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
This commit is contained in:
Thorsten Scherf 2023-12-17 17:19:38 +01:00 committed by Florence Blanc-Renaud
parent a177121af6
commit 821259f069

View File

@ -167,7 +167,8 @@ def get_cert_path(cert_path):
if cert_path is not None:
return cert_path
if os.path.exists(paths.IPA_CA_CRT):
if os.path.exists(paths.IPA_CA_CRT) and \
os.stat(paths.IPA_CA_CRT).st_size != 0:
return paths.IPA_CA_CRT
return None