[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#92757: marked as done (apt-get fails to connect through a socks server)



Your message dated Mon, 20 Aug 2001 22:46:30 -0600 (MDT)
with message-id <Pine.LNX.3.96.1010820224454.12485A-100000@wakko.deltatee.com>
and subject line Fixed in apt 0.5.4
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Darren Benham
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 3 Apr 2001 16:35:08 +0000
>From michel.casabona@free.fr Tue Apr 03 11:35:08 2001
Return-path: <michel.casabona@free.fr>
Received: from smtp2.free.fr [212.27.32.6] (root)
	by master.debian.org with esmtp (Exim 3.12 1 (Debian))
	id 14kTls-0004Ee-00; Tue, 03 Apr 2001 11:35:08 -0500
Received: from imp1-1.free.fr (imp1-1.free.fr [213.228.0.21])
	by smtp2.free.fr (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id SAA13231;
	Tue, 3 Apr 2001 18:35:06 +0200
Received: (from www-data@localhost)
	by imp1-1.free.fr (8.9.3/8.9.3/Debian 8.9.3-21) id SAA12157;
	Tue, 3 Apr 2001 18:35:06 +0200
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: apt-get fails to connect through a socks server
Message-ID: <986315706.3ac9fbba701a3@imp.free.fr>
Date: Tue, 03 Apr 2001 18:35:06 +0200 (MEST)
From: Michel Casabona <michel.casabona@free.fr>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
User-Agent: IMP/PHP IMAP webmail program 2.2.3
X-Originating-IP: 194.196.100.101
Delivered-To: submit@bugs.debian.org

Subject: apt-get fails to connect through a socks server
Package: apt
Version: 0.5.3
Severity: normal


-- System Information
Debian Release: testing/unstable
Kernel Version: Linux agenor 2.2.18 #1 Mon Jan 8 17:41:03 CET 2001 i586 unknown

Versions of the packages apt depends on:
ii  libc6          2.2.2-1        GNU C Library: Shared libraries and Timezone
ii  libstdc++2.10- 2.95.3-6       The GNU stdc++ library

Since I've migrated from 0.3.x to 0.5.3 (in testing), apt-get fails to connect
through a socks server. I'm using dante-client:

agenor:/etc/apt# socksify apt-get update
Err ftp://ftp.uk.debian.org woody/main Packages     
  Unable to determine the local name - getsockname (105 No buffer space
available)
 ...

Of course there is plenty of buffer space available.
The source code for dante Rgetsockname function gives a hint:

michel@agenor:dante-1.1.8$ head -83 lib/Rgetsockname.c | tail -16
                case SOCKS_CONNECT:
                        if (socksfd->state.inprogress) {
                                if (socksfd->state.err != 0) /* connect failed.
*/
                                        errno = socksfd->state.err;
                                else
                                        /* 
                                         * XXX
                                         * this is bad but we don't know what
address the socksserver
                                         * will use on our behalf yet.  Lets
hope the client
                                         * will retry on this error.
                                         * Another option might be to wait here
until the 
                                         * socksnegotiation has completed, but
applications probably
                                         * don't expect getsockname(2) to block.
                                        */
                                        errno = ENOBUFS;
                                return -1;

So it might be a timing problem. Indeed, moving back getsockname for the local
name from FTPConn:Open() to FTPConn:CreateDataFd() cures the problem. 
Here is the patch:

michel@agenor:apt$ diff -u methods/ftp.cc-org methods/ftp.cc
--- methods/ftp.cc-org  Thu Mar  8 03:20:43 2001
+++ methods/ftp.cc      Mon Mar 26 18:51:27 2001
@@ -160,9 +160,9 @@
       return _error->Errno("getpeername","Unable to determine the peer name");
    
    // Get the local machine's address
-   ServerAddrLen = sizeof(ServerAddr);
+/*   ServerAddrLen = sizeof(ServerAddr);
    if (getsockname(ServerFd,(sockaddr *)&ServerAddr,&ServerAddrLen) != 0)
-      return _error->Errno("getsockname","Unable to determine the local name");
+      return _error->Errno("getsockname","Unable to determine the local name");
*/
    
    Owner->Status("Logging in");
    return Login();
@@ -731,6 +731,11 @@
       return _error->Errno("listen","Could not listen on the socket");
    SetNonBlock(DataListenFd,true);
    
+   // Get the local machine's address
+   ServerAddrLen = sizeof(ServerAddr);
+   if (getsockname(ServerFd,(sockaddr *)&ServerAddr,&ServerAddrLen) != 0)
+      return _error->Errno("getsockname","Unable to determine the local name");
+
    // Determine the name to send to the remote
    struct sockaddr_storage Addr;
    socklen_t AddrLen = sizeof(Addr);

The patch only restores the old apt 0.3.x behaviour. I've no idea if it's the
right fix, but it demonstrates the timing problem. 

Thanks,

Michel Casabona

---------------------------------------
Received: (at 92757-done) by bugs.debian.org; 21 Aug 2001 04:46:44 +0000
>From jgg@debian.org Mon Aug 20 23:46:44 2001
Return-path: <jgg@debian.org>
Received: from cast-ext.ab.videon.ca [206.75.216.34] 
	by master.debian.org with smtp (Exim 3.12 1 (Debian))
	id 15Z3R6-0000y4-00; Mon, 20 Aug 2001 23:46:44 -0500
Received: (qmail 1390 invoked from network); 21 Aug 2001 04:46:39 -0000
Received: from unknown (HELO wakko.deltatee.com) ([24.108.173.63]) (envelope-sender <jgg@debian.org>)
          by cast-ext.ab.videon.ca (qmail-ldap-1.03) with SMTP
          for <56708-done@bugs.debian.org>; 21 Aug 2001 04:46:39 -0000
Received: from localhost
	([127.0.0.1] helo=wakko.deltatee.com ident=jgg)
	by wakko.deltatee.com with smtp (Exim 3.16 #1 (Debian))
	id 15Z3Qt-0003KS-00; Mon, 20 Aug 2001 22:46:31 -0600
Date: Mon, 20 Aug 2001 22:46:30 -0600 (MDT)
From: Jason Gunthorpe <jgg@debian.org>
X-Sender: jgg@wakko.deltatee.com
To: 56708-done@bugs.debian.org, 59432-done@bugs.debian.org, 
    65691-done@bugs.debian.org, 86954-done@bugs.debian.org, 
    88913-done@bugs.debian.org, 89066-done@bugs.debian.org, 
    89066-done@bugs.debian.org, 89121-done@bugs.debian.org, 
    89152-done@bugs.debian.org, 89671-done@bugs.debian.org, 
    89762-done@bugs.debian.org, 89854-done@bugs.debian.org, 
    90027-done@bugs.debian.org, 92025-done@bugs.debian.org, 
    92033-done@bugs.debian.org, 92757-done@bugs.debian.org, 
    93057-done@bugs.debian.org, 93652-done@bugs.debian.org, 
    94286-done@bugs.debian.org, 94618-done@bugs.debian.org, 
    95823-done@bugs.debian.org, 97364-done@bugs.debian.org, 
    97520-done@bugs.debian.org, 97520-done@bugs.debian.org, 
    97809-done@bugs.debian.org, 98272-done@bugs.debian.org, 
    98353-done@bugs.debian.org, 98468-done@bugs.debian.org, 
    98695-done@bugs.debian.org, 98928-done@bugs.debian.org, 
    99671-done@bugs.debian.org, 99974-done@bugs.debian.org, 
    100046-done@bugs.debian.org, 100325-done@bugs.debian.org, 
    100590-done@bugs.debian.org, 101071-done@bugs.debian.org, 
    101565-done@bugs.debian.org, 102293-done@bugs.debian.org, 
    102421-done@bugs.debian.org, 102867-done@bugs.debian.org, 
    102951-done@bugs.debian.org, 103020-done@bugs.debian.org, 
    105377-done@bugs.debian.org, 105606-done@bugs.debian.org, 
    106591-done@bugs.debian.org, 106911-done@bugs.debian.org, 
    106914-done@bugs.debian.org, 107362-done@bugs.debian.org, 
    107362-done@bugs.debian.org, 107395-done@bugs.debian.org, 
    107395-done@bugs.debian.org, 108968-done@bugs.debian.org
Subject: Fixed in apt 0.5.4
Message-ID: <Pine.LNX.3.96.1010820224454.12485A-100000@wakko.deltatee.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Delivered-To: 92757-done@bugs.debian.org

 apt (0.5.4) unstable; urgency=low
 
   * M68k config.guess patch. Closes: #88913
   * Bi-yearly test on OpenBSD and Solaris
   * Doc updates. Closes: #89121, #89854, #99671, #98353, #95823, #93057,
           #97520, #102867, #101071, #102421, #101565, #98272, #106914,
           #105606, #105377
   * Various cosmetic code updates. Closes: #89066, #89066, #89152
   * Add "pre-auto" as an option for DSelect::Clean (run autoclean after
     update).
   * More patches from Alfredo for Vendors and more SHA-1 stuff
   * Fix for AJ's 'desire to remove perl-5.005' and possibly other
     similar situations. Closes: #56708, #59432
   * no_proxy and ftp. Closes: #89671
   * Philippe Batailler's man page patches.
   * Fix for display bug. Closes: #92033, #93652, #98468
   * Use more than 16bits for the dep ID. Some people ran out..
     Closes: #103020, #97809, #102951, #99974, #107362, #107395, #107362,
             #106911, #107395, #108968
   * Reordered some things to make dante and FTP happier. Closes: #92757
   * James R. Van Zandt's guide.sgml updates. Closes: #90027
   * apt-ftparchive copes with no uncompressed package files + contents.
   * French man pages from philippe batailler - well sort of. They
     don't build yet..
   * run-parts. Closes: #94286
   * 'apt-cache policy' preferences debug tool.
   * Whatever. Closes: #89762
   * libstdc++ and HURD. Closes: #92025
   * More apt-utils verbage. Closes: #86954
   * Fliped comparision operator. Closes: #94618
   * Used the right copyright file. Closes: #65691
   * Randolph's G++3 patches.
   * Fixed no_proxy tokanizing. Closes: #100046
   * Strip Config-Version when copying status to available. Closes: #97520
   * Segfault with missing source files. Closes: #100325
   * EINTR check. Closes: #102293
   * Various changes to the locking metholodgy for --print-uris.
     Closes: #100590
   * Lame LD_LIBRARY_PATH thing. Closes: #98928
   * apt-cache search searchs provide names too now. Closes: #98695
   * Checksum and long lines problem. Closes: #106591
   * .aptignr and empty files are just a warning. Closes: #97364




Reply to: