[RFH] - git-svn auth bug (possibly SVN 1.5.0-related)

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[RFH] - git-svn auth bug (possibly SVN 1.5.0-related)

Eric Wong
Brad King <[hidden email]> wrote:

> Eric Wong wrote:
> > Brad King <[hidden email]> wrote:
> >> Eric Wong wrote:
> >>> I haven't had the chance to look at this.   Can anybody else shed more
> >>> light on that bug?  It's really strange that the tests won't run because
> >>> of it.  Are you unable to run some git-svn tests or all of them?
> >> Just that one fails.  All others (including the one in the patch below) pass.
> >
> > Exactly which test fails for you?  Perhaps it's some setting in your
> > ~/.subversion/config that's causing it to fail.  Maybe we should set
> > $HOME and use a clean ~/.subversion/config for git-svn tests regardless
> > if that turns out to be the case...
>
> $ cd $gitsrc/t
> $ export SVNSERVE_PORT=5432
> $ ./t9113-git-svn-dcommit-new-file.sh
> *   ok 1: start tracking an empty repo
> * FAIL 2: create files in new directory with dcommit
>
>                 mkdir git-new-dir &&
>                 echo hello > git-new-dir/world &&
>                 git update-index --add git-new-dir/world &&
>                 git commit -m hello &&
>                 start_svnserve &&
>                 git svn dcommit
>
> * failed 1 among 2 test(s)
>
> I hacked the test script to log the dcommit output to a file, and I see
> this:
>
> Committing to svn://127.0.0.1:5432 ...
> Use of uninitialized value in concatenation (.) or string at
> /usr/lib/perl5/SVN/Core.pm line 584.
> Authorization failed:  at $gitsrc/t/../git-svn line 3329
>
> (I replaced my git source dir full path with $gitsrc).
>
> The version of libsvn-perl is:  1.5.0dfsg1-4

It could be another incompatibility introduced in SVN 1.5.0.

I'll try to dist-upgrade a machine to Lenny sometime in the next two
weeks so I can test; I'm pretty busy these days but if anybody else
wants to figure this out in the meantime, please do :)

> Please let me know if you need more info.
>
> I tried moving my ~/.subversion/config out of the way but it makes no
> difference.  However, I agree we should block the user's home svn config
> when running other dcommit tests now that we have auto-props.  Perhaps
> just using the --config-dir option with an empty directory would be enough.

Thanks for the additional info!

--
Eric Wong
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: [RFH] - git-svn auth bug (possibly SVN 1.5.0-related)

Dmitry Potapov
On Sun, Aug 03, 2008 at 03:02:51PM -0700, Eric Wong wrote:
>
> It could be another incompatibility introduced in SVN 1.5.0.
>
> I'll try to dist-upgrade a machine to Lenny sometime in the next two
> weeks so I can test; I'm pretty busy these days but if anybody else
> wants to figure this out in the meantime, please do :)

The problem happens only if you use FS format 3 regardless what version
of SVN perl binding you use. Also, there is no problem with using SVN
1.5 (I tried 1.5.1) as long as you use FS format 2 (I tested git-svn
with libsvn-perl 1.4.2 and 1.5.1 works fine) but if your repository is
initialized to use FS format 3 (which is the default in SVN 1.5) then
this problem happens with all versions of SVN perl binding, and it
happens exactly in the same place:

 /home/dpotapov/git/git-svn:3333:    my @ce  = $opts->{ra}->get_commit_editor($opts->{log},
sub get_commit_editor {
 /home/dpotapov/git/git-svn:3909:    my ($self, $log, $cb, $pool) = @_;
 /home/dpotapov/git/git-svn:3910:    my @lock = $SVN::Core::VERSION ge '1.2.0' ? (undef, 0) : ();
 /home/dpotapov/git/git-svn:3911:    $self->SUPER::get_commit_editor($log, $cb, @lock, $pool);
sub AUTOLOAD {
 /usr/lib/perl5/SVN/Ra.pm:74:     my $class = ref($_[0]);
 /usr/lib/perl5/SVN/Ra.pm:75:     my $method = $AUTOLOAD;
 /usr/lib/perl5/SVN/Ra.pm:76:     $method =~ s/.*:://;
 /usr/lib/perl5/SVN/Ra.pm:77:     return unless $method =~ m/[^A-Z]/;
 /usr/lib/perl5/SVN/Ra.pm:79:     my $self = shift;
 /usr/lib/perl5/SVN/Ra.pm:82:     my $func = $self->{session}->can ($method)
 /usr/lib/perl5/SVN/Ra.pm:85:     my @ret = $func->($self->{session}, @_);

Numbers of lines may be different for different versions of libsvn-perl,
but the effect is exactly the same. Instead of going to the next line
and completing AUTOLOAD, if you use FS format 3 then you end up in
croak_on_error(), which uses some uninitialized value in string
concatenation (which produces an additional warning) and then calls
croak(). End of the story :(


Dmitry
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: [RFH] - git-svn auth bug (possibly SVN 1.5.0-related)

Dmitry Potapov
On Mon, Aug 04, 2008 at 06:18:20PM +0400, Dmitry Potapov wrote:
> Numbers of lines may be different for different versions of libsvn-perl,
> but the effect is exactly the same. Instead of going to the next line
> and completing AUTOLOAD, if you use FS format 3 then you end up in
> croak_on_error(), which uses some uninitialized value in string
> concatenation (which produces an additional warning) and then calls
> croak(). End of the story :(

I think I have figured out that is wrong. It is a bug in initialization
of SVN database. Before, there was only one [general] section in the
conf/svnserve.conf file and the procedure of initialization apparently
copied a template and added the following string to the end of file:

anon-access = write

but now there are two sections: [general] and [sasl]

as result "anon-access = write" is added to the wrong section,
and there is no anonymous access anymore. So, the test fails.


Dmitry
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

[PATCH] correct access right for git-svn-dcommit test

Dmitry Potapov
The tests requires anonymous write access. Therefore, "anon-access =
write" is added to conf/svnserve.conf. But because it was added to
the end of the file, it is impossible to guarantee in what section
it will be located. It turned out that on SVN 1.5, it was placed in
the wrong section and as result the test failed.

Signed-off-by: Dmitry Potapov <[hidden email]>
---
 t/t9113-git-svn-dcommit-new-file.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/t/t9113-git-svn-dcommit-new-file.sh b/t/t9113-git-svn-dcommit-new-file.sh
index 8da8ce5..ae78e33 100755
--- a/t/t9113-git-svn-dcommit-new-file.sh
+++ b/t/t9113-git-svn-dcommit-new-file.sh
@@ -28,6 +28,7 @@ start_svnserve () {
 
 test_expect_success 'start tracking an empty repo' '
  svn mkdir -m "empty dir" "$svnrepo"/empty-dir &&
+ echo "[general]" > "$rawsvnrepo"/conf/svnserve.conf &&
  echo anon-access = write >> "$rawsvnrepo"/conf/svnserve.conf &&
  start_svnserve &&
  git svn init svn://127.0.0.1:$SVNSERVE_PORT &&
--
1.6.0.rc1.74.g1e94

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] correct access right for git-svn-dcommit test

Brad King
Dmitry Potapov wrote:

> The tests requires anonymous write access. Therefore, "anon-access =
> write" is added to conf/svnserve.conf. But because it was added to
> the end of the file, it is impossible to guarantee in what section
> it will be located. It turned out that on SVN 1.5, it was placed in
> the wrong section and as result the test failed.
>
> Signed-off-by: Dmitry Potapov <[hidden email]>
> ---
>  t/t9113-git-svn-dcommit-new-file.sh |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/t/t9113-git-svn-dcommit-new-file.sh b/t/t9113-git-svn-dcommit-new-file.sh
> index 8da8ce5..ae78e33 100755
> --- a/t/t9113-git-svn-dcommit-new-file.sh
> +++ b/t/t9113-git-svn-dcommit-new-file.sh
> @@ -28,6 +28,7 @@ start_svnserve () {
>  
>  test_expect_success 'start tracking an empty repo' '
>   svn mkdir -m "empty dir" "$svnrepo"/empty-dir &&
> + echo "[general]" > "$rawsvnrepo"/conf/svnserve.conf &&
>   echo anon-access = write >> "$rawsvnrepo"/conf/svnserve.conf &&
>   start_svnserve &&
>   git svn init svn://127.0.0.1:$SVNSERVE_PORT &&

I just tried this patch and it does fix the test on my system.

Thanks,
-Brad
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] correct access right for git-svn-dcommit test

Eric Wong
In reply to this post by Dmitry Potapov
Dmitry Potapov <[hidden email]> wrote:
> The tests requires anonymous write access. Therefore, "anon-access =
> write" is added to conf/svnserve.conf. But because it was added to
> the end of the file, it is impossible to guarantee in what section
> it will be located. It turned out that on SVN 1.5, it was placed in
> the wrong section and as result the test failed.
>
> Signed-off-by: Dmitry Potapov <[hidden email]>

Brad and Dmitry: Thank you both very much.

Acked-by: Eric Wong <[hidden email]>

> ---
>  t/t9113-git-svn-dcommit-new-file.sh |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/t/t9113-git-svn-dcommit-new-file.sh b/t/t9113-git-svn-dcommit-new-file.sh
> index 8da8ce5..ae78e33 100755
> --- a/t/t9113-git-svn-dcommit-new-file.sh
> +++ b/t/t9113-git-svn-dcommit-new-file.sh
> @@ -28,6 +28,7 @@ start_svnserve () {
>  
>  test_expect_success 'start tracking an empty repo' '
>   svn mkdir -m "empty dir" "$svnrepo"/empty-dir &&
> + echo "[general]" > "$rawsvnrepo"/conf/svnserve.conf &&
>   echo anon-access = write >> "$rawsvnrepo"/conf/svnserve.conf &&
>   start_svnserve &&
>   git svn init svn://127.0.0.1:$SVNSERVE_PORT &&
> --
> 1.6.0.rc1.74.g1e94
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html