mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-26 16:16:31 -06:00
Avoid growing FILE ccaches unnecessarily
Related https://pagure.io/freeipa/issue/6775 Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-By: Christian Heimes <cheimes@redhat.com> Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
parent
dc13703e75
commit
9a6ac74eb4
@ -111,6 +111,12 @@ def store_data(princ_name, key, value):
|
||||
if not isinstance(value, bytes):
|
||||
value = value.encode('utf-8')
|
||||
|
||||
# FILE ccaches grow every time an entry is stored, so we need
|
||||
# to avoid storing the same entry multiple times.
|
||||
oldvalue = get_data(princ_name, key)
|
||||
if oldvalue == value:
|
||||
return
|
||||
|
||||
context = krb5_context()
|
||||
principal = krb5_principal()
|
||||
ccache = krb5_ccache()
|
||||
|
Loading…
Reference in New Issue
Block a user