[krb5-auth-dialog] credentials_expiring_real: check if kcontext is valid
- From: Guido Günther <guidog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [krb5-auth-dialog] credentials_expiring_real: check if kcontext is valid
- Date: Fri, 7 Jul 2017 07:21:40 +0000 (UTC)
commit 23ba826890d60c3c556a8d1a021e97b8d3fb416c
Author: Guido Günther <agx sigxcpu org>
Date: Fri Jul 7 09:10:37 2017 +0200
credentials_expiring_real: check if kcontext is valid
othewise we might crash when the credentials_expiring_once fires but
we're already shutting down.
Reference: https://bugs.launchpad.net/bugs/1700468
src/ka-kerberos.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/ka-kerberos.c b/src/ka-kerberos.c
index 0fbaf88..d17a63e 100644
--- a/src/ka-kerberos.c
+++ b/src/ka-kerberos.c
@@ -218,6 +218,9 @@ credentials_expiring_real (KaApplet *applet)
krb5_timestamp now;
gboolean retval = FALSE;
+ if (!kcontext_valid)
+ return retval;
+
memset (&my_creds, 0, sizeof (my_creds));
ka_applet_set_tgt_renewable (applet, FALSE);
if (!ka_get_tgt_from_ccache (kcontext, &my_creds)) {
@@ -938,8 +941,8 @@ static gboolean
ka_krb5_context_free ()
{
if (kcontext_valid) {
- krb5_free_context (kcontext);
kcontext_valid = FALSE;
+ krb5_free_context (kcontext);
}
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]