Exemplo n.º 1
0
static void
mount_operation_reply (GMountOperation        *mount_operation,
                       GMountOperationResult  result,
                       gpointer               user_data)
{
  ProxyMountOpData *data = user_data;
  GVfsRemoteVolumeMonitor *proxy;
  const gchar *user_name;
  const gchar *domain;
  const gchar *password;
  gchar *encoded_password;
  gint password_save;
  gint choice;
  gboolean anonymous;
  
  user_name     = g_mount_operation_get_username (mount_operation);
  domain        = g_mount_operation_get_domain (mount_operation);
  password      = g_mount_operation_get_password (mount_operation);
  password_save = g_mount_operation_get_password_save (mount_operation);
  choice        = g_mount_operation_get_choice (mount_operation);
  anonymous     = g_mount_operation_get_anonymous (mount_operation);

  if (user_name == NULL)
    user_name = "";
  if (domain == NULL)
    domain = "";
  if (password == NULL)
    password = "";

  /* NOTE: this is not to add "security", it's merely to prevent accidental exposure
   *       of passwords when running dbus-monitor
   */
  encoded_password = g_base64_encode ((const guchar *) password, (gsize) (strlen (password) + 1));

  proxy = g_proxy_volume_monitor_get_dbus_proxy (data->monitor);
  gvfs_remote_volume_monitor_call_mount_op_reply (proxy,
                                                  data->id,
                                                  result,
                                                  user_name,
                                                  domain,
                                                  encoded_password,
                                                  password_save,
                                                  choice,
                                                  anonymous,
                                                  NULL,
                                                  (GAsyncReadyCallback) mount_op_reply_cb,
                                                  data);
  g_object_unref (proxy);
  g_free (encoded_password);
}
Exemplo n.º 2
0
static VALUE
mountoperation_password(VALUE self)
{
	return CSTR2RVAL(g_mount_operation_get_password(_SELF(self)));
}