diff options
author | Carlos Garcia Campos <carlosgc@gnome.org> | 2008-02-25 20:08:28 +0000 |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@src.gnome.org> | 2008-02-25 20:08:28 +0000 |
commit | e4af3df72bf4aa44e539db78d95ff311990eb512 (patch) | |
tree | 85f2f3a76412246d4883a894e2918d47a2342861 /daemon/gvfskeyring.c | |
parent | d966b3ade7d0d864f827417b015251454d96e9e2 (diff) | |
download | gvfs-e4af3df72bf4aa44e539db78d95ff311990eb512.tar.gz |
Update to gvfskeyring api changes
2008-02-25 Carlos Garcia Campos <carlosgc@gnome.org>
* daemon/gvfsbackendsftp.c:
* daemon/gvfsbackendsmb.c:
Update to gvfskeyring api changes
* daemon/gvfskeyring.c:
* daemon/gvfskeyring.h:
Add object, authtype and port parameters for both save and
lookup.
svn path=/trunk/; revision=1374
Diffstat (limited to 'daemon/gvfskeyring.c')
-rw-r--r-- | daemon/gvfskeyring.c | 52 |
1 files changed, 29 insertions, 23 deletions
diff --git a/daemon/gvfskeyring.c b/daemon/gvfskeyring.c index 583db085..1863ff18 100644 --- a/daemon/gvfskeyring.c +++ b/daemon/gvfskeyring.c @@ -33,7 +33,7 @@ gboolean g_vfs_keyring_is_available (void) { #ifdef HAVE_KEYRING - return gnome_keyring_is_available (); + return gnome_keyring_is_available (); #else return FALSE; #endif @@ -44,35 +44,38 @@ g_vfs_keyring_lookup_password (const gchar *username, const gchar *host, const gchar *domain, const gchar *protocol, + const gchar *object, + const gchar *authtype, + guint32 port, gchar **username_out, gchar **domain_out, gchar **password_out) { #ifdef HAVE_KEYRING - GnomeKeyringNetworkPasswordData *pwd_data; - GnomeKeyringResult result; - GList *plist; + GnomeKeyringNetworkPasswordData *pwd_data; + GnomeKeyringResult result; + GList *plist; - if (!gnome_keyring_is_available ()) - return FALSE; + if (!gnome_keyring_is_available ()) + return FALSE; - result = gnome_keyring_find_network_password_sync ( + result = gnome_keyring_find_network_password_sync ( username, domain, host, - NULL, + object, protocol, - NULL, - 0, + authtype, + port, &plist); - if (result != GNOME_KEYRING_RESULT_OK || plist == NULL) - return FALSE; + if (result != GNOME_KEYRING_RESULT_OK || plist == NULL) + return FALSE; - /* We use the first result, which is the least specific match */ - pwd_data = (GnomeKeyringNetworkPasswordData *)plist->data; + /* We use the first result, which is the least specific match */ + pwd_data = (GnomeKeyringNetworkPasswordData *)plist->data; - *password_out = g_strdup (pwd_data->password); + *password_out = g_strdup (pwd_data->password); if (username_out) *username_out = g_strdup (pwd_data->user); @@ -80,9 +83,9 @@ g_vfs_keyring_lookup_password (const gchar *username, if (domain_out) *domain_out = g_strdup (pwd_data->domain); - gnome_keyring_network_password_list_free (plist); - - return TRUE; + gnome_keyring_network_password_list_free (plist); + + return TRUE; #else return FALSE; #endif /* HAVE_KEYRING */ @@ -93,6 +96,9 @@ g_vfs_keyring_save_password (const gchar *username, const gchar *host, const gchar *domain, const gchar *protocol, + const gchar *object, + const gchar *authtype, + guint32 port, const gchar *password, GPasswordSave flags) { @@ -101,8 +107,8 @@ g_vfs_keyring_save_password (const gchar *username, const gchar *keyring; guint32 item_id; - if (!gnome_keyring_is_available ()) - return FALSE; + if (!gnome_keyring_is_available ()) + return FALSE; if (flags == G_PASSWORD_SAVE_NEVER) return FALSE; @@ -114,10 +120,10 @@ g_vfs_keyring_save_password (const gchar *username, username, domain, host, - NULL, + object, protocol, - NULL, - 0, + authtype, + port, password, &item_id); |