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

[PATCH] Fix SASL + svnsync + pre-revprop-change problems

From: Vlad Georgescu <vgeorgescu_at_gmail.com>
Date: 2006-10-30 20:24:51 CET

On 9/26/06, Garrett Rooney <rooneg@electricjellyfish.net> wrote:
> So, I've been trying to figure out why the svnsync tests fail over
> ra_svn when you turn on the server side sasl support. Here's what
> I've come up with so far:
>
> 1) svnsync tests work fine over ra_svn without sasl
>
> 2) with sasl and forking enabled we get errors like this:
>
> ['subversion/libsvn_repos/hooks.c:111: (apr_err=165001)\n', "svnsync:
> Failed to start
> '/home/rooneg/code/svn-trunk/subversion/tests/cmdline/svn-test-work/repositories/svnsync_tests-1-1/hooks/pre-revprop-change'
> hook\n", 'subversion/libsvn_subr/utf.c:621: (apr_err=22)\n', 'svnsync:
> Valid UTF-8 data\n', '(hex: 48 6b 0f 08 41 41 41 41 40)\n', 'followed
> by invalid UTF-8 sequence\n', '(hex: 9b 0f 08 a1)\n']
>
> 3) turn off forking and that particular symptom goes away
>
> 4) running svnserve under valgrind with either forking or threading
> and sasl enabled results in dozens of errors, basically every time we
> do anything with the connection pool it complains:
>
> ==5067== Invalid read of size 1
> ==5067== at 0x401E3AB: memcpy (mac_replace_strmem.c:394)
> ==5067== by 0x415F5DF: apr_pstrdup (apr_strings.c:79)
> ==5067== by 0x8054421: svn_repos_get_commit_editor4 (commit.c:818)
> ==5067== by 0x804F17C: commit (serve.c:962)
> ==5067== by 0x80A5299: svn_ra_svn_handle_commands (marshal.c:838)
> ==5067== by 0x805299B: serve (serve.c:2305)
> ==5067== by 0x804C237: serve_thread (main.c:253)
> ==5067== by 0x4169991: dummy_worker (thread.c:105)
> ==5067== by 0x41E6340: start_thread (in
> /lib/tls/i686/cmov/libpthread-2.3.6.so)

Hi Garrett,

The following patch should fix these problems.

[[[
Fix a memory access problem with svnsync over ra_svn when SASL is enabled.

* subversion/svnserve/sasl_auth.c
  (sasl_auth_request): Allocate b->user in b->pool rather than pool.
]]]

Index: subversion/svnserve/sasl_auth.c
===================================================================
--- subversion/svnserve/sasl_auth.c (revision 22157)
+++ subversion/svnserve/sasl_auth.c (working copy)
@@ -329,7 +329,7 @@

       if ((p = strchr(user, '@')) != NULL)
         /* Drop the realm part. */
- b->user = apr_pstrndup(pool, user, p - (char *)user);
+ b->user = apr_pstrndup(b->pool, user, p - (char *)user);
       else
         {
           svn_error_t *err;

-- 
Vlad
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Oct 30 20:25:11 2006

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.