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

[PATCH] r25137 causes compile failures if sasl is available

From: Kamesh Jayachandran <kamesh_at_collab.net>
Date: 2007-05-25 13:03:43 CEST

Hi All,

Attached patch fixes the same.

Ran svnserveautocheck observed all PASS.

With regards
Kamesh Jayachandran

[[[

r25137 breaks sasl builds because of 'svn_atomic__init_once' signature change.

* subversion/include/private/ra_svn_sasl.h
  (svn_ra_svn__sasl_common_init): Accepts 'pool'.

* subversion/libsvn_ra_svn/ra_svn.h
  (svn_ra_svn__sasl_init): Accepts 'pool'.

* subversion/svnserve/server.h
  (cyrus_init): Accepts 'pool'.

* subversion/libsvn_ra_svn/cyrus_auth.c
  (svn_ra_svn__sasl_common_init): Create sasl_pool from the passed in pool.
  (sasl_init_cb): Accepts 'pool'. Passes the pool to
  'svn_ra_svn__sasl_common_init'
  (svn_ra_svn__sasl_init): Accepts 'pool'. Passes the pool to
  'svn_atomic__init_once'

* subversion/libsvn_ra_svn/client.c
  (svn_ra_svn__init): Passes 'pool' to 'svn_ra_svn__sasl_init'.

* subversion/svnserve/cyrus_auth.c
  (initialize): Accepts 'pool'. Passes 'pool' to
  'svn_ra_svn__sasl_common_init'.
  (cyrus_init): Accepts 'pool'. Passes the pool to
  'svn_atomic__init_once'
  
* subversion/svnserve/main.c
  (main): Create 'pool' prior to 'cyrus_init' and pass it cyrus_init.

Patch by: kameshj
]]]

Index: subversion/include/private/ra_svn_sasl.h
===================================================================
--- subversion/include/private/ra_svn_sasl.h (revision 25143)
+++ subversion/include/private/ra_svn_sasl.h (working copy)
@@ -41,8 +41,8 @@
 void svn_ra_svn__default_secprops(sasl_security_properties_t *secprops);
 
 /* This function is called by the client and the server before
- calling sasl_{client, server}_init. */
-apr_status_t svn_ra_svn__sasl_common_init(void);
+ calling sasl_{client, server}_init, pool is used for allocations. */
+apr_status_t svn_ra_svn__sasl_common_init(apr_pool_t *pool);
 
 /* Sets local_addrport and remote_addrport to a string containing the
    remote and local IP address and port, formatted like this: a.b.c.d;port. */
Index: subversion/libsvn_ra_svn/ra_svn.h
===================================================================
--- subversion/libsvn_ra_svn/ra_svn.h (revision 25143)
+++ subversion/libsvn_ra_svn/ra_svn.h (working copy)
@@ -203,8 +203,8 @@
                                        const char *mech, const char *mech_arg,
                                        svn_boolean_t compat);
 
-/* Initialize the SASL library. */
-svn_error_t *svn_ra_svn__sasl_init(void);
+/* Initialize the SASL library. POOL is used for allocations. */
+svn_error_t *svn_ra_svn__sasl_init(apr_pool_t *pool);
 
 
 #ifdef __cplusplus
Index: subversion/svnserve/server.h
===================================================================
--- subversion/svnserve/server.h (revision 25143)
+++ subversion/svnserve/server.h (working copy)
@@ -111,8 +111,8 @@
                           const char *base,
                           apr_pool_t *pool);
 
-/* Initialize the Cyrus SASL library. */
-svn_error_t *cyrus_init(void);
+/* Initialize the Cyrus SASL library. POOL is used for allocations. */
+svn_error_t *cyrus_init(apr_pool_t *pool);
 
 /* Authenticate using Cyrus SASL. */
 svn_error_t *cyrus_auth_request(svn_ra_svn_conn_t *conn,
Index: subversion/libsvn_ra_svn/cyrus_auth.c
===================================================================
--- subversion/libsvn_ra_svn/cyrus_auth.c (revision 25143)
+++ subversion/libsvn_ra_svn/cyrus_auth.c (working copy)
@@ -142,11 +142,11 @@
 }
 #endif /* APR_HAS_THREADS */
 
-apr_status_t svn_ra_svn__sasl_common_init(void)
+apr_status_t svn_ra_svn__sasl_common_init(apr_pool_t *pool)
 {
   apr_status_t apr_err = APR_SUCCESS;
 
- sasl_pool = svn_pool_create(NULL);
+ sasl_pool = svn_pool_create(pool);
   sasl_ctx_count = 1;
   apr_pool_cleanup_register(sasl_pool, NULL, sasl_done_cb,
                             apr_pool_cleanup_null);
@@ -163,18 +163,18 @@
   return apr_err;
 }
 
-static svn_error_t *sasl_init_cb(void)
+static svn_error_t *sasl_init_cb(apr_pool_t *pool)
 {
- if (svn_ra_svn__sasl_common_init() != APR_SUCCESS
+ if (svn_ra_svn__sasl_common_init(pool) != APR_SUCCESS
       || sasl_client_init(NULL) != SASL_OK)
     return svn_error_create(SVN_ERR_RA_NOT_AUTHORIZED, NULL,
                             _("Could not initialize the SASL library"));
   return SVN_NO_ERROR;
 }
 
-svn_error_t *svn_ra_svn__sasl_init(void)
+svn_error_t *svn_ra_svn__sasl_init(apr_pool_t *pool)
 {
- SVN_ERR(svn_atomic__init_once(&svn_ra_svn__sasl_status, sasl_init_cb));
+ SVN_ERR(svn_atomic__init_once(&svn_ra_svn__sasl_status, sasl_init_cb, pool));
   return SVN_NO_ERROR;
 }
 
Index: subversion/libsvn_ra_svn/client.c
===================================================================
--- subversion/libsvn_ra_svn/client.c (revision 25143)
+++ subversion/libsvn_ra_svn/client.c (working copy)
@@ -2015,7 +2015,7 @@
   *vtable = &ra_svn_vtable;
 
 #ifdef SVN_HAVE_SASL
- SVN_ERR(svn_ra_svn__sasl_init());
+ SVN_ERR(svn_ra_svn__sasl_init(pool));
 #endif
 
   return SVN_NO_ERROR;
Index: subversion/svnserve/cyrus_auth.c
===================================================================
--- subversion/svnserve/cyrus_auth.c (revision 25143)
+++ subversion/svnserve/cyrus_auth.c (working copy)
@@ -93,12 +93,12 @@
   { SASL_CB_LIST_END, NULL, NULL }
 };
 
-static svn_error_t *initialize(void)
+static svn_error_t *initialize(apr_pool_t *pool)
 {
   int result;
   apr_status_t status;
 
- status = svn_ra_svn__sasl_common_init();
+ status = svn_ra_svn__sasl_common_init(pool);
   if (status)
     return svn_error_wrap_apr(status,
                               _("Could not initialize the SASL library"));
@@ -116,9 +116,9 @@
   return SVN_NO_ERROR;
 }
 
-svn_error_t *cyrus_init(void)
+svn_error_t *cyrus_init(apr_pool_t *pool)
 {
- SVN_ERR(svn_atomic__init_once(&svn_ra_svn__sasl_status, initialize));
+ SVN_ERR(svn_atomic__init_once(&svn_ra_svn__sasl_status, initialize, pool));
   return SVN_NO_ERROR;
 }
 
Index: subversion/svnserve/main.c
===================================================================
--- subversion/svnserve/main.c (revision 25143)
+++ subversion/svnserve/main.c (working copy)
@@ -335,13 +335,13 @@
   if (svn_cmdline_init("svnserve", stderr) != EXIT_SUCCESS)
     return EXIT_FAILURE;
 
+ /* Create our top-level pool. */
+ pool = svn_pool_create(NULL);
+
 #ifdef SVN_HAVE_SASL
- SVN_INT_ERR(cyrus_init());
+ SVN_INT_ERR(cyrus_init(pool));
 #endif
 
- /* Create our top-level pool. */
- pool = svn_pool_create(NULL);
-
   /* Check library versions */
   err = check_lib_versions();
   if (err)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri May 25 13:03:29 2007

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