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

Re: Subversion and FreeBSD permission problems

From: Darrell Blake <darrell.blake_at_gmail.com>
Date: Sun, 23 Mar 2008 23:06:09 +0000

I applied the patch from the diff manually as there were only a few
changes, but I'm still getting the same problem.

My make_connection() function in client.c looks like the below, which
is correct as of the patch. Excuse the lack of indentation but I was
in a hurry to see if it worked =o)

static svn_error_t *make_connection(const char *hostname, unsigned short port,
                                    apr_socket_t **sock, apr_pool_t *pool)
{
  apr_sockaddr_t *sa;
  apr_status_t status;
  int family = APR_INET;

  /* Make sure we have IPV6 support first before giving apr_sockaddr_info_get
     APR_UNSPEC, because it may give us back an IPV6 address even if we can't
     create IPV6 sockets. */

#if APR_HAVE_IPV6
#ifdef MAX_SECS_TO_LINGER
  status = apr_socket_create(sock, APR_INET6, SOCK_STREAM, pool);
#else
  status = apr_socket_create(sock, APR_INET6, SOCK_STREAM,
                             APR_PROTO_TCP, pool);
#endif
  if (status == 0)
    {
      apr_socket_close(*sock);
      family = APR_UNSPEC;
    }
#endif

  /* Resolve the hostname. */
  status = apr_sockaddr_info_get(&sa, hostname, family, port, 0, pool);
  if (status)
    return svn_error_createf(status, NULL, _("Unknown hostname '%s'"),
                             hostname);

  /* Create the socket. */
do
{

#ifdef MAX_SECS_TO_LINGER
  /* ### old APR interface */
  status = apr_socket_create(sock, sa->family, SOCK_STREAM, pool);
#else
  status = apr_socket_create(sock, sa->family, SOCK_STREAM, APR_PROTO_TCP,
                             pool);
#endif
 if (status == APR_SUCCESS)
{
status = apr_socket_connect(*sock, sa);
if (status != APR_SUCCESS)
apr_socket_close(*sock);
}
sa = sa->next;
}
while(status != APR_SUCCESS && sa);

if (status)
    return svn_error_wrap_apr(status, _("Can't connect to host '%s'"),
                              hostname);

  return SVN_NO_ERROR;
}

I can't help but think it's something to do with permissions. I've
just tried to do an SVN checkout using TortoiseSVN on
svn://192.168.0.10/TestProject on an external windows box and I just
get the error "Error: Can't connect to host '192.168.0.10': No
connection could be made because the target machine actively refused
it."

On Sun, Mar 23, 2008 at 5:54 PM, Stefan Sperling <stsp_at_elego.de> wrote:
>
> The bug is present in 1.4.
>
> See the make_connection function in
> http://svn.collab.net/repos/svn/branches/1.4.x/subversion/libsvn_ra_svn/client.c
>
> It just tries the first address given to it by APR.
> After the call to apr_sockaddr_info_get, the sa variable may be
> the head of a *list* to addres*ses*, not just a single address.
> 1.4 isn't walking the list.
>
> Trunk is now walking the list, see the same function in
> http://svn.collab.net/repos/svn/trunk/subversion/libsvn_ra_svn/client.c
>
> However, the APR version Stefan Küng linked his 1.4 binaries with may
> have no IPv6 support, in which case the bug isn't triggered.
>
> Well, unless you want to connect to an IPv4 host with multiple DNS
> A records (i.e. the hostname resolves to more than one IP).
> In this case the bug is also triggered, since only the first IPv4 address
> is tried. If the server isn't configured to accept connections on the
> svnserve port on that IP, you can't connect. This is arguably a server
> setup error though, so in practice the bug bites IPv4/IPv6 dual stack
> servers connecting to themselves the most, because there 'localhost'
> always resolves to two IPs, one for IPv4 and one for IPv6.
>
> --
>
>
> Stefan Sperling <stsp_at_elego.de> Software Developer
> elego Software Solutions GmbH HRB 77719
> Gustav-Meyer-Allee 25, Gebaeude 12 Tel: +49 30 23 45 86 96
> 13355 Berlin Fax: +49 30 23 45 86 95
> http://www.elego.de Geschaeftsfuehrer: Olaf Wagner
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-03-24 00:06:34 CET

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.