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

Re: Bug with http: URLs with functions from the client module in the Python bindings

From: David James <james_at_cs.toronto.edu>
Date: 2006-12-19 19:07:40 CET

On 12/19/06, Christian Boos <cboos@neuf.fr> wrote:
> SIGSEGV
> 0xb7b4fefb in svn_auth_set_parameter (auth_baton=0x0, name=0x0,
> value=0x0) at auth.c:144

This is a bug. Instead of segfaulting, the Python bindings should
report that you forgot to initialize the suite of context providers in
the auth_baton. We should definitely patch the Python bindings to
check for whether auth_baton has been correctly initialized, because
this is a common typo which has bit many people. We should also add
some documentation which explains how to setup the auth_baton. (Anyone
care to submit a patch, either for the documentation, or for adding an
extra check? If you do, please CC me so that I will remember to review
it).

We should probably also patch the client.py test suite for the Python
bindings to correctly setup the auth_baton, so that people don't get
bit when they copy and paste examples from the test suite.

> > Alternatively, it can well be a misuse of the API, in which case I'd
> > be glad to get a few pointers to the relevant documentation (well,
> > besides the doxygen documentation for the C API and the Python binding
> > tests).
>
> So it looks very much like a misuse of the svn_client_ctx_t, which is
> used uninitialized.
> Any pointers about how to set this up correctly would be appreciated!

Here's how to setup the authentication providers. I borrowed this
example from http://svn.collab.net/repos/svn/trunk/contrib/client-side/svn_export_empty_files.py

    # Give the client context baton a suite of authentication
    # providers.
    providers = [
        client.get_simple_provider(),
        client.get_ssl_client_cert_file_provider(),
        client.get_ssl_client_cert_pw_file_provider(),
        client.get_ssl_server_trust_file_provider(),
        client.get_username_provider(),
    ]

    client_ctx.auth_baton = core.svn_auth_open(providers)

I tested adding this code to your script, and your script works great!
The new version of your script is attached and it works great on my
machine.

Cheers,

David

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Tue Dec 19 19:07:57 2006

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