~ubuntu-branches/ubuntu/utopic/gnome-online-accounts/utopic

« back to all changes in this revision

Viewing changes to src/daemon/goadaemon.c

  • Committer: Package Import Robot
  • Author(s): Andreas Henriksson, Laurent Bigonville, Andreas Henriksson
  • Date: 2014-05-16 11:42:52 UTC
  • mfrom: (1.1.28) (0.1.12 sid)
  • Revision ID: package-import@ubuntu.com-20140516114252-u5ect6mk6ht8i38x
Tags: 3.12.2-1
[ Laurent Bigonville ]
* debian/control.in: Recommends realmd package (Closes: #725965)

[ Andreas Henriksson ]
* New upstream release.
  - Removes chat support from Windows Live provider (XMPP gateway gone).
* Bump Standards-Version to 3.9.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
 * Lesser General Public License for more details.
14
14
 *
15
15
 * You should have received a copy of the GNU Lesser General
16
 
 * Public License along with this library; if not, write to the
17
 
 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18
 
 * Boston, MA 02111-1307, USA.
 
16
 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
19
17
 *
20
18
 * Author: David Zeuthen <davidz@redhat.com>
21
19
 */
28
26
 
29
27
#include "goadaemon.h"
30
28
#include "goabackend/goabackend.h"
31
 
#include "goabackend/goalogging.h"
32
29
#include "goabackend/goautils.h"
33
30
#ifdef GOA_KERBEROS_ENABLED
34
31
#include "goaidentity/goaidentityservice.h"
140
137
 
141
138
  if (monitor == NULL)
142
139
    {
143
 
      goa_warning ("Error monitoring %s at %s: %s (%s, %d)",
144
 
                   is_dir ? "directory" : "file",
145
 
                   path,
146
 
                   error->message, g_quark_to_string (error->domain), error->code);
 
140
      g_warning ("Error monitoring %s at %s: %s (%s, %d)",
 
141
                 is_dir ? "directory" : "file",
 
142
                 path,
 
143
                 error->message, g_quark_to_string (error->domain), error->code);
147
144
      g_error_free (error);
148
145
    }
149
146
  g_object_unref (file);
157
154
  GoaDaemon *daemon = GOA_DAEMON (user_data);
158
155
 
159
156
  daemon->config_timeout_id = 0;
160
 
  goa_info ("Reloading configuration files\n");
 
157
  g_info ("Reloading configuration files\n");
161
158
  goa_daemon_reload_configuration (daemon);
162
159
 
163
160
  return FALSE;
215
212
  path = g_strdup_printf ("%s/goa-1.0", g_get_user_config_dir ());
216
213
  if (g_mkdir_with_parents (path, 0755) != 0)
217
214
    {
218
 
      goa_warning ("Error creating directory %s: %m", path);
 
215
      g_warning ("Error creating directory %s: %m", path);
219
216
    }
220
217
  g_free (path);
221
218
 
237
234
  if (!goa_identity_service_activate (daemon->identity_service,
238
235
                                      &error))
239
236
    {
240
 
      goa_warning ("Error activating identity service: %s", error->message);
 
237
      g_warning ("Error activating identity service: %s", error->message);
241
238
      g_error_free (error);
242
239
      g_clear_object (&daemon->identity_service);
243
240
    }
355
352
    {
356
353
      if (!(error->domain == G_FILE_ERROR && error->code == G_FILE_ERROR_NOENT))
357
354
        {
358
 
          goa_warning ("Error loading %s: %s (%s, %d)",
359
 
                       path,
360
 
                       error->message, g_quark_to_string (error->domain), error->code);
 
355
          g_warning ("Error loading %s: %s (%s, %d)",
 
356
                     path,
 
357
                     error->message, g_quark_to_string (error->domain), error->code);
361
358
        }
362
359
      g_error_free (error);
363
360
      g_key_file_free (key_file);
394
391
                  if (session_id != NULL &&
395
392
                      g_strcmp0 (session_id, guid) != 0)
396
393
                    {
397
 
                      goa_debug ("ignoring account \"%s\" in file %s because it's stale",
398
 
                                 groups[n], path);
 
394
                      g_debug ("ignoring account \"%s\" in file %s because it's stale",
 
395
                               groups[n], path);
399
396
                      g_free (groups[n]);
400
397
                      g_free (session_id);
401
398
                      continue;
413
410
            }
414
411
          else
415
412
            {
416
 
              goa_warning ("Unexpected group \"%s\" in file %s", groups[n], path);
 
413
              g_warning ("Unexpected group \"%s\" in file %s", groups[n], path);
417
414
              g_free (groups[n]);
418
415
            }
419
416
        }
458
455
  icon = NULL;
459
456
  serialized_icon = NULL;
460
457
 
461
 
  goa_debug ("updating %s %d", g_dbus_object_get_object_path (G_DBUS_OBJECT (object)), just_added);
 
458
  g_debug ("updating %s %d", g_dbus_object_get_object_path (G_DBUS_OBJECT (object)), just_added);
462
459
 
463
460
  type = g_key_file_get_string (key_file, group, "Provider", NULL);
464
461
  identity = g_key_file_get_string (key_file, group, "Identity", NULL);
476
473
  provider = goa_provider_get_for_provider_type (type);
477
474
  if (provider == NULL)
478
475
    {
479
 
      goa_warning ("Unsupported account type %s for identity %s (no provider)", type, identity);
 
476
      g_warning ("Unsupported account type %s for identity %s (no provider)", type, identity);
480
477
      goto out;
481
478
    }
482
479
 
488
485
  error = NULL;
489
486
  if (!goa_provider_build_object (provider, object, key_file, group, daemon->connection, just_added, &error))
490
487
    {
491
 
      goa_warning ("Error parsing account: %s (%s, %d)",
492
 
                   error->message, g_quark_to_string (error->domain), error->code);
 
488
      g_warning ("Error parsing account: %s (%s, %d)",
 
489
                 error->message, g_quark_to_string (error->domain), error->code);
493
490
      g_error_free (error);
494
491
      goto out;
495
492
    }
563
560
      object_path = g_strdup_printf ("/org/gnome/OnlineAccounts/Accounts/%s", id + sizeof "Account " - 1);
564
561
      if (strstr (id + sizeof "Account " - 1, "/") != NULL || !g_variant_is_object_path (object_path))
565
562
        {
566
 
          goa_warning ("`%s' is not a valid account identifier", id);
 
563
          g_warning ("`%s' is not a valid account identifier", id);
567
564
          g_free (object_path);
568
565
          continue;
569
566
        }
589
586
      g_signal_handlers_disconnect_by_func (goa_object_peek_account (object),
590
587
                                            G_CALLBACK (on_account_handle_remove),
591
588
                                            daemon);
592
 
      goa_debug ("removing %s", object_path);
 
589
      g_debug ("removing %s", object_path);
593
590
      g_warn_if_fail (g_dbus_object_manager_server_unexport (daemon->object_manager, object_path));
594
591
    }
595
592
  for (l = added; l != NULL; l = l->next)
598
595
      GoaObjectSkeleton *object;
599
596
      gchar *group;
600
597
 
601
 
      goa_debug ("adding %s", object_path);
 
598
      g_debug ("adding %s", object_path);
602
599
 
603
600
      group = object_path_to_group (object_path);
604
601
      key_file_data = g_hash_table_lookup (group_name_to_key_file_data, group);
631
628
      GoaObject *object;
632
629
      gchar *group;
633
630
 
634
 
      goa_debug ("unchanged %s", object_path);
 
631
      g_debug ("unchanged %s", object_path);
635
632
 
636
633
      group = object_path_to_group (object_path);
637
634
      key_file_data = g_hash_table_lookup (group_name_to_key_file_data, group);
1131
1128
            {
1132
1129
              goa_account_set_attention_needed (account, TRUE);
1133
1130
              g_dbus_interface_skeleton_flush (G_DBUS_INTERFACE_SKELETON (account));
1134
 
              goa_notice ("%s: Setting AttentionNeeded to TRUE because EnsureCredentials() failed with: %s (%s, %d)",
1135
 
                          g_dbus_object_get_object_path (G_DBUS_OBJECT (data->object)),
1136
 
                          error->message, g_quark_to_string (error->domain), error->code);
 
1131
              g_message ("%s: Setting AttentionNeeded to TRUE because EnsureCredentials() failed with: %s (%s, %d)",
 
1132
                         g_dbus_object_get_object_path (G_DBUS_OBJECT (data->object)),
 
1133
                         error->message, g_quark_to_string (error->domain), error->code);
1137
1134
            }
1138
1135
        }
1139
1136
      g_dbus_method_invocation_return_gerror (data->invocation, error);
1149
1146
        {
1150
1147
          goa_account_set_attention_needed (account, FALSE);
1151
1148
          g_dbus_interface_skeleton_flush (G_DBUS_INTERFACE_SKELETON (account));
1152
 
          goa_notice ("%s: Setting AttentionNeeded to FALSE because EnsureCredentials() succeded\n",
1153
 
                      g_dbus_object_get_object_path (G_DBUS_OBJECT (data->object)));
 
1149
          g_message ("%s: Setting AttentionNeeded to FALSE because EnsureCredentials() succeded\n",
 
1150
                     g_dbus_object_get_object_path (G_DBUS_OBJECT (data->object)));
1154
1151
        }
1155
1152
      goa_account_complete_ensure_credentials (goa_object_peek_account (data->object),
1156
1153
                                               data->invocation,