mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-08-13 06:25:00 -05: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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user