Hello Gunnar,

could you please test that this works for you? It's already committed in 
r1865, so if you're on HEAD you won't need that.


Regards,

Phil


-- 
Versioning your /etc, /home or even your whole installation?
             Try fsvs (fsvs.tigris.org)!
Index: src/options.h
===================================================================
--- src/options.h	(Revision 1864)
+++ src/options.h	(Arbeitskopie)
@@ -105,6 +105,9 @@ enum opt__settings_e {
 	/** The base path of the configuration area.
 	 * See \ref o_conf. */
 	OPT__CONF_PATH,
+	/** The config directory to use.
+	 * See \ref o_configdir. */
+	OPT__CONFIG_DIR,
 
 	/** End of enum marker. */
 	OPT__COUNT
Index: src/interface.h
===================================================================
--- src/interface.h	(Revision 1864)
+++ src/interface.h	(Arbeitskopie)
@@ -43,6 +43,9 @@
 #define DEFAULT_WAA_PATH "/var/spool/fsvs"
 /** The default CONF path. */
 #define DEFAULT_CONF_PATH "/etc/fsvs"
+/** The default config directory (for authentication data),
+ * relative to $FSVS_CONF. */
+#define DEFAULT_CONFIGDIR_SUB "/auth/"
 
 
 /** \name List of environment variables used for a chroot jail.
Index: src/waa.c
===================================================================
--- src/waa.c	(Revision 1864)
+++ src/waa.c	(Arbeitskopie)
@@ -158,6 +158,8 @@ inline void waa___init_path(enum opt__se
 int waa__init(void)
 {
 	int status;
+	char *cp;
+	int len;
 
 
 	status=0;
@@ -245,6 +247,21 @@ int waa__init(void)
 	opt__set_int( OPT__SOFTROOT, PRIO_MUSTHAVE, 
 			opt__get_int(OPT__SOFTROOT));
 
+
+	if (opt__get_int(OPT__CONFIG_DIR)==0)
+	{
+		len=opt__get_int(OPT__CONF_PATH)+strlen(DEFAULT_CONFIGDIR_SUB)+1;
+
+		cp=malloc(len);
+		STOPIF_ENOMEM(!cp);
+
+		strcpy(cp, opt__get_string(OPT__CONF_PATH));
+		strcat(cp, DEFAULT_CONFIGDIR_SUB);
+
+		opt__set_string(OPT__CONFIG_DIR, PRIO_MUSTHAVE, cp);
+		opt__set_int(OPT__CONFIG_DIR, PRIO_MUSTHAVE, len-1);
+	}
+
 ex:
 	return status;
 }
Index: src/dox/options.dox
===================================================================
--- src/dox/options.dox	(Revision 1864)
+++ src/dox/options.dox	(Arbeitskopie)
@@ -17,6 +17,7 @@ FSVS currently knows:<UL>
 <LI>\c commit_to - \ref o_commit_to
 <LI>\c conflict - \ref o_conflict
 <LI>\c conf - \ref o_conf.
+<LI>\c config_dir - \ref o_configdir.
 <LI>\c copyfrom_exp - \ref o_copyfrom_exp
 <LI>\c debug_output - \ref o_debug_output
 <LI>\c delay - \ref o_delay
@@ -584,5 +585,20 @@ howto_backup_recovery for further discus
 variables (\c $FSVS_CONF resp. \c $FSVS_WAA) or as command line parameter; 
 settings in config files are ignored.
 
+
+\section o_configdir Configuration directory for the subversion libraries
+
+This path specifies where the subversion libraries should take their
+configuration data from; the most important aspect of that is authentication
+data, especially for certificate authentication.
+
+The default value is \c $FSVS_CONF/auth/.
+
+\c /etc/fsvs/config could have eg.
+\code
+	config_dir=/root/.subversion
+\endcode
+
+
  */
 // vi: filetype=doxygen spell spelllang=en_gb formatoptions+=ta : 
Index: src/racallback.c
===================================================================
--- src/racallback.c	(Revision 1864)
+++ src/racallback.c	(Arbeitskopie)
@@ -18,7 +18,6 @@
 #include <subversion-1/svn_ra.h>
 #include <subversion-1/svn_auth.h>
 #include <subversion-1/svn_client.h>
-#include <subversion-1/svn_config.h>
 #include <subversion-1/svn_cmdline.h>
 
 
@@ -41,13 +40,12 @@ svn_error_t *cb__init(apr_pool_t *pool)
 	svn_config_t *cfg;
 
 
-	status=0;
-	STOPIF_SVNERR(svn_config_get_config,
-			(&cfg_hash, NULL, pool) );
+	STOPIF( hlp__get_svn_config(&cfg_hash), NULL);
 
 	cfg = apr_hash_get(cfg_hash, SVN_CONFIG_CATEGORY_CONFIG,
 			APR_HASH_KEY_STRING);
 
+
 	/* Set up Authentication stuff. */
 	STOPIF_SVNERR( svn_cmdline_setup_auth_baton,
 			(&cb__cb_table.auth_baton,
@@ -55,8 +53,8 @@ svn_error_t *cb__init(apr_pool_t *pool)
 			 opt__get_int(OPT__AUTHOR) ? 
 			 opt__get_string(OPT__AUTHOR) : NULL,
 			 NULL, /* Password */
-			 NULL, /* Config dir */
-			 1, /* no_auth_cache */
+			 opt__get_string(OPT__CONFIG_DIR),
+			 0, /* no_auth_cache */
 			 cfg,
 			 NULL, /* cancel function */
 			 NULL, /* cancel baton */
Index: src/url.c
===================================================================
--- src/url.c	(Revision 1864)
+++ src/url.c	(Arbeitskopie)
@@ -12,6 +12,7 @@
 #include <ctype.h>
 #include <sys/select.h>
 
+
 #include "url.h"
 #include "waa.h"
 #include "cache.h"
@@ -868,6 +869,8 @@ int url__open_session(svn_ra_session_t *
 {
 	int status;
 	svn_error_t *status_svn;
+	apr_hash_t *cfg;
+
 
 	status=0;
 	if (!current_url->pool)
@@ -877,13 +880,15 @@ int url__open_session(svn_ra_session_t *
 				"no pool");
 	}
 
+	STOPIF( hlp__get_svn_config(&cfg), NULL);
+
 	/** Try svn_ra_reparent() */
 	if (!current_url->session)
 	{
 		STOPIF_SVNERR_EXTRA( svn_ra_open,
 				(& current_url->session, current_url->url,
 				 &cb__cb_table, NULL,  /* cbtable, cbbaton, */
-				 NULL,	/* config hash */
+				 cfg,	/* config hash */
 				 current_url->pool),
 				"Opening URL '%s' brought an error:", current_url->url);
 
Index: src/helper.c
===================================================================
--- src/helper.c	(Revision 1864)
+++ src/helper.c	(Arbeitskopie)
@@ -19,6 +19,7 @@
 #include <pwd.h>
 #include <apr_file_io.h>
 #include <apr_md5.h>
+#include <subversion-1/svn_config.h>
 
 #include "global.h"
 #include "waa.h"
@@ -1833,3 +1834,26 @@ int hlp__rename_to_unique(char *fn, char
 ex:
 	return status;
 }
+
+
+/** -.
+ * Caches the result, so that the configuration is only fetched a single time.
+ */
+int hlp__get_svn_config(apr_hash_t **config)
+{
+	int status;
+	svn_error_t *status_svn;
+	static apr_hash_t *cfg=NULL;
+
+
+	status=0;
+	/* We assume that a config hash as NULL will never be returned.
+	 * (Else we'd try to fetch it more than once.) */
+	if (!cfg)
+		STOPIF_SVNERR( svn_config_get_config,
+				(&cfg, opt__get_string(OPT__CONFIG_DIR), global_pool));
+
+	*config=cfg;
+ex:
+	return status;
+}
Index: src/helper.h
===================================================================
--- src/helper.h	(Revision 1864)
+++ src/helper.h	(Arbeitskopie)
@@ -163,4 +163,8 @@ int hlp__rename_to_unique(char *fn, char
 		const char **unique_name, 
 		apr_pool_t *pool);
 
+
+/** Reads the subversion config file(s), found by \ref o_configdir. */
+int hlp__get_svn_config(apr_hash_t **config);
+
 #endif
Index: src/options.c
===================================================================
--- src/options.c	(Revision 1864)
+++ src/options.c	(Arbeitskopie)
@@ -225,6 +225,11 @@ struct opt__list_t opt__list[OPT__COUNT]
 			 .cp_val=DEFAULT_CONF_PATH, .i_val=strlen(DEFAULT_CONF_PATH), */
 		.cp_val=NULL, .i_val=0,
 	},
+	[OPT__CONFIG_DIR] = {
+		.name="config_dir", .parse=opt___store_string,
+		.cp_val=NULL, .i_val=0,
+	},
+
 
 	[OPT__EMPTY_COMMIT] = {
 		.name="empty_commit", .i_val=OPT__YES, 
Index: CHANGES
===================================================================
--- CHANGES	(Revision 1864)
+++ CHANGES	(Arbeitskopie)
@@ -2,6 +2,7 @@ Changes since 1.1.16
 - New "uncopy" command, to disambiguate "revert". Manually added or 
 	"prop-set" entries are kept known.
 - Small cleanups and documentation updates.
+- New option "config_dir", important for client certificate authentication.
 - Performance fix for "fsvs diff -rX:Y entry" - don't diff the whole
   working copy, only the given entries.
 - "fsvs info" for the working copy root now prints the revision of the 
Index: example/setup.sh
===================================================================
--- example/setup.sh	(Revision 1864)
+++ example/setup.sh	(Arbeitskopie)
@@ -41,7 +41,7 @@ else
 # Create local filelist, to make "fsvs ps" work.
 	fsvs checkout file://$location/trunk/etc 
 
-  fsvs ignore '/etc/**.dpkg-old' '/etc/**.dpkg-bak'
+  fsvs ignore '/etc/**.dpkg-old' '/etc/**.dpkg-new' '/etc/**.dpkg-dist' '/etc/**.dpkg-bak'
   fsvs ignore '/etc/**.bak' '/etc/**.old' '/etc/**~' '/**.swp'
 # easy to remake, no big deal (?)
   fsvs ignore '/etc/ssh/ssh_host_*key'

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to