[gnome-online-accounts/wip/rishi/kcm-notification: 4/4] kerberos-identity-manager: Use notifications for KCM credential caches
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-accounts/wip/rishi/kcm-notification: 4/4] kerberos-identity-manager: Use notifications for KCM credential caches
- Date: Tue, 20 Oct 2020 18:10:21 +0000 (UTC)
commit 9e7f91026c3aa420774d37ebec96a2e9e438556e
Author: Debarshi Ray <debarshir gnome org>
Date: Tue Oct 20 19:54:00 2020 +0200
kerberos-identity-manager: Use notifications for KCM credential caches
https://gitlab.gnome.org/GNOME/gnome-online-accounts/-/merge_requests/61
src/goaidentity/goakerberosidentitymanager.c | 30 ++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
---
diff --git a/src/goaidentity/goakerberosidentitymanager.c b/src/goaidentity/goakerberosidentitymanager.c
index 50db6ed7..38014ab8 100644
--- a/src/goaidentity/goakerberosidentitymanager.c
+++ b/src/goaidentity/goakerberosidentitymanager.c
@@ -1407,6 +1407,36 @@ monitor_credentials_cache (GoaKerberosIdentityManager *self,
g_object_unref (directory);
g_object_unref (file);
}
+ else if (strcmp (cache_type, "KCM") == 0)
+ {
+ GError *create_error = NULL;
+ GFile *directory = NULL;
+ GFile *file = NULL;
+ GFileOutputStream *stream = NULL;
+ const gchar *runtime_dir;
+
+ runtime_dir = g_get_user_runtime_dir ();
+ directory = g_file_new_for_path (runtime_dir);
+ file = g_file_get_child (directory, ".kcm-notifications");
+
+ monitoring_error = NULL;
+
+ stream = g_file_create (file, G_FILE_CREATE_NONE, NULL, &create_error);
+ if (create_error != NULL)
+ {
+ if (g_error_matches (create_error, G_IO_ERROR, G_IO_ERROR_EXISTS))
+ g_error_free (create_error);
+ else
+ g_propagate_error (&monitoring_error, create_error);
+ }
+
+ if (monitoring_error == NULL)
+ monitor = g_file_monitor_file (file, G_FILE_MONITOR_NONE, NULL, &monitoring_error);
+
+ g_clear_object (&stream);
+ g_object_unref (directory);
+ g_object_unref (file);
+ }
if (monitor == NULL)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]