Check ccache size before trying to use it

This commit is contained in:
Daniel Juarez 2022-02-22 12:02:44 +01:00 committed by Tomas Kopecek
parent 1a71dcef81
commit e596ca6fcb

View file

@ -6617,6 +6617,10 @@ if __name__ == "__main__":
if krb_principal is None:
krb_principal = options.host_principal_format % socket.getfqdn()
try:
# Check ccache is not empty or authentication will fail
if os.stat(options.ccache).st_size == 0:
os.remove(options.ccache)
session.gssapi_login(principal=krb_principal,
keytab=options.keytab,
ccache=options.ccache)