Ken Allan <k.allan@au.darkbluesea.com>


Patch
r857693

r857693 | mbk | 2005-12-04 02:16:04 +0000 (Sun, 04 Dec 2005)

On Mac OS, use KeyChain services to store password (Issue 2339).

Note: SecKeychainSetUserInteractionAllowed (FALSE) does not appear to
actually prevent all user interaction.  Specifically, if the executable
changes (for example, if it is rebuilt), the system prompts the user
to okay the use of the new executable.

I'm not sure if I'm doing something wrong, or if this is a genuine bug
in the KeyChain implementation itself.

Suggested by: Wilfredo Sánchez <wsanchez@wsanchez.net>
Patch by: Ken Allan <k.allan@au.darkbluesea.com>
          Wilfredo Sánchez <wsanchez@wsanchez.net>
          me
Review by: djames


* Makefile.in:
  Add SVN_KEYCHAIN_LIBS, an autoconf substituted variable.
  Add SVN_KEYCHAIN_INCLUDES to INCLUDES.

* build.conf:
  Define keychain, an external lib, using the SVN_KEYCHAIN_LIBS variable.
  Add keychain to the libs for the svn exe.

* configure.in:
  Add --enable-keychain/--disable-keychain configury.  Default to enabled,
  if the appropriate OS and version are detected.

* subversion/include/svn_auth.h:
  (svn_auth_get_keychain_simple_provider): New prototype.

* subversion/libsvn_subr/cmdline.c:
  #include "svn_auth.h"
  (svn_cmdline_setup_auth_baton): Add keychain provider to list,
   and though not strictly required, increase the initial array size
   accordingly.

* subversion/libsvn_subr/simple_providers.c:
  #include "svn_private_config.h"
  (SVN_AUTH__KEYCHAIN_PASSWORD_TYPE): New password-type macro.
  Conditionally #include <Security/Security.h>
  (keychain_password_set, keychain_password_get, keychain_simple_first_creds,
   keychain_simple_save_creds, svn_auth_get_keychain_simple_provider): New
   functions.
  (keychain_simple_provider): New svn_auth_provider_t instance.