Skip to content

Commit

Permalink
Fix log spam related to kerberos ticket renewal (#13934)
Browse files Browse the repository at this point in the history
If directory services become disabled through non-standard means
(for instance manually editing DB) then we should terminate this
loop. Only check lifetime if we have a kerberos ticket.
  • Loading branch information
anodos325 authored Jun 26, 2024
1 parent 9d38df1 commit c102da1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/middlewared/middlewared/plugins/kerberos.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,10 +532,18 @@ def wait_for_renewal(self, job):
if (cred := gss_get_current_cred(krb5ccache.SYSTEM.value, raise_error=False)) is None:
# We don't have kerberos ticket or it has already expired
# We can redo our kinit
ds = self.middleware.call_sync('directoryservices.status')
if ds['type'] is None:
self.logger.debug(
'Directory services are disabled. Exiting job to wait '
'for renewal of kerberos ticket.'
)
break

self.logger.debug('Kerberos ticket check failed, getting new ticket')
self.middleware.call_sync('kerberos.start')

if cred.lifetime <= KRB_TKT_CHECK_INTERVAL:
elif cred.lifetime <= KRB_TKT_CHECK_INTERVAL:
self.middleware.call_sync('kerberos.start')

time.sleep(KRB_TKT_CHECK_INTERVAL)
Expand Down

0 comments on commit c102da1

Please sign in to comment.