[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] unlock gnome-keyring

From: Alexander Thomas <alexander_at_collab.net>
Date: Fri, 12 Dec 2008 11:03:18 +0530

Here is a patch which try to address a Subversion issues with gnome
keyring support. Present implementation of gnome-keyring fails to access
a locked keyring and if there is no X present.

This patch, try to unlock the keyring by prompting the user for keyring
password only if the default keyring is locked.

Patch might not be well written, I got some concerns over it. I
appreciate if someone can guide me to make it better.

Here are couple of questions.

1. Patch uses svn_cmdline_auth_simple_prompt() to prompt the user to
key-in default keyring password. This might be okay for SVN cmdline.
But at the API level, third party applications won;t be able plugin
their custom password prompt. So how I do it?

I got a suggestion for this, but don't know how difficult to implement
it. Can this be implemented with auth providers, where we add a new
vtable entry in addition to existing first_credentials, next_credentials
and save_credentials. We can call new vtable entry as

2. The patch written with lot of helper functions, which made the patch
look ugly. The reason why I wrote it this way is to make patch work with
the primitive versions of gnome-keyring (RHEL4 uses gnome-keyring
version < 0.5). With the gnome-keyring version >= 0.8, we can avoid
using this help functions and can rewrite the patch in much lesser
lines. So should I need to rewrite this patch and make subversion
dependent of gnome-keyring version >= 0.8.

Prompts for default keyring password if the keyring is locked
and unlocks the keyring.

* subversion/libsvn_auth_gnome_keyring/gnome_keyring.c
  (gnome_keyring_baton): New struct.
  (callback_destroy_data_keyring): New helper function
   to do cleanup.
  (callback_done): New helper function.
  (callback_get_info_keyring): New helper function to
   handle keyring details.
  (callback_default_keyring): New helper function for
   getting the default keyring name.
  (gnome_keyring_unlock_keyring): New function, which
   will prompt for the keyring password and unlocks
   the keyring if it is already locked.
  (gnome_keyring_password_get): Use gnome_keyring_unlock_keyring()
   to unlock a keyring and later does the cleanup.
  (gnome_keyring_password_set): Use gnome_keyring_unlock_keyring()
   to unlock a keyring and later does the cleanup.

-Alexander Thomas (AT)


Received on 2008-12-12 11:44:02 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.