~ubuntu-branches/ubuntu/raring/vino/raring-proposed

« back to all changes in this revision

Viewing changes to server/vino-server.c

  • Committer: Package Import Robot
  • Author(s): Robert Ancell
  • Date: 2012-08-21 17:07:41 UTC
  • mfrom: (1.1.63)
  • Revision ID: package-import@ubuntu.com-20120821170741-zj374mk9p2ij8jvr
Tags: 3.5.90-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
#include <sys/poll.h>
40
40
#include <gtk/gtk.h>
41
41
 
42
 
#ifdef VINO_HAVE_GNOME_KEYRING
43
 
#include <gnome-keyring.h>
 
42
#ifdef VINO_HAVE_SECRET
 
43
#include <libsecret/secret.h>
44
44
#endif
45
45
 
46
46
G_DEFINE_TYPE (VinoServer, vino_server, G_TYPE_OBJECT);
697
697
static char *
698
698
vino_server_get_password_from_keyring (VinoServer *server)
699
699
{
700
 
#ifdef VINO_HAVE_GNOME_KEYRING
701
 
  GnomeKeyringNetworkPasswordData *found_item;
702
 
  GnomeKeyringResult               result;
703
 
  GList                           *matches;
704
 
  char                            *password;
705
 
  
706
 
  matches = NULL;
707
 
 
708
 
  result = gnome_keyring_find_network_password_sync (
709
 
                NULL,           /* user     */
710
 
                NULL,           /* domain   */
711
 
                "vino.local",   /* server   */
712
 
                NULL,           /* object   */
713
 
                "rfb",          /* protocol */
714
 
                "vnc-password", /* authtype */
715
 
                5900,           /* port     */
716
 
                &matches);
717
 
 
718
 
  if (result != GNOME_KEYRING_RESULT_OK || matches == NULL || matches->data == NULL)
719
 
    return NULL;
720
 
 
721
 
 
722
 
  found_item = (GnomeKeyringNetworkPasswordData *) matches->data;
723
 
 
724
 
  password = g_strdup (found_item->password);
725
 
 
726
 
  gnome_keyring_network_password_list_free (matches);
727
 
 
728
 
  return password;
 
700
#ifdef VINO_HAVE_SECRET
 
701
  return secret_password_lookup_sync (SECRET_SCHEMA_COMPAT_NETWORK,
 
702
                                      NULL, NULL,
 
703
                                      "server", "vino.local",
 
704
                                      "protocol", "rfb",
 
705
                                      "authtype", "vnc-password",
 
706
                                      "port", 5900,
 
707
                                      NULL);
729
708
#else
730
709
  return NULL;
731
710
#endif