Package: apt-proxy Version: 1.9.35 Severity: normal Hi
Apt-proxy lacks adequate protection against multiple simultaneous downloads of the same file. From my logs, $ sudo grep kdenetwork-dbg /var/log/apt-proxy.log 2006/11/11 14:34 EST [Channel,3,192.168.1.23] [CacheEntry] start download:pool/main/k/kdenetwork/kdenetwork-dbg_3.5.5-2_i386.deb 2006/11/11 14:34 EST [ThrottlingProtocol,client] [CacheEntry] download started:/var/cache/apt-proxy/debian/pool/main/k/kdenetwork/kdenetwork-dbg_3.5.5-2_i386.deb 2006/11/11 14:37 EST [Channel,4,192.168.1.23] [CacheEntry] start download:pool/main/k/kdenetwork/kdenetwork-dbg_3.5.5-2_i386.deb 2006/11/11 14:45 EST [Channel,5,192.168.1.23] [CacheEntry] start download:pool/main/k/kdenetwork/kdenetwork-dbg_3.5.5-2_i386.deb 2006/11/11 14:45 EST [ThrottlingProtocol,client] [CacheEntry] download started:/var/cache/apt-proxy/debian/pool/main/k/kdenetwork/kdenetwork-dbg_3.5.5-2_i386.deb 2006/11/11 14:47 EST [Channel,6,192.168.1.23] [CacheEntry] start download:pool/main/k/kdenetwork/kdenetwork-dbg_3.5.5-2_i386.deb 2006/11/11 14:47 EST [ThrottlingProtocol,client] [CacheEntry] download_data_end:/var/cache/apt-proxy/debian/pool/main/k/kdenetwork/kdenetwork-dbg_3.5.5-2_i386.deb 2006/11/11 14:47 EST [ThrottlingProtocol,client] [CacheEntry] file_sent:/var/cache/apt-proxy/debian/pool/main/k/kdenetwork/kdenetwork-dbg_3.5.5-2_i386.deb 2006/11/11 14:47 EST [ThrottlingProtocol,client] [CacheEntry] download started:/var/cache/apt-proxy/debian/pool/main/k/kdenetwork/kdenetwork-dbg_3.5.5-2_i386.deb 2006/11/11 14:49 EST [-] [verify] cache file verification FAILED for /var/cache/apt-proxy/debian/pool/main/k/kdenetwork/kdenetwork-dbg_3.5.5-2_i386.deb: dpkg failed 2006/11/11 14:49 EST [-] [CacheEntry] start download:pool/main/k/kdenetwork/kdenetwork-dbg_3.5.5-2_i386.deb 2006/11/11 14:52 EST [Channel,9,192.168.1.23] [CacheEntry] start download:pool/main/k/kdenetwork/kdenetwork-dbg_3.5.5-2_i386.deb 2006/11/11 14:54 EST [Channel,10,192.168.1.23] [CacheEntry] start download:pool/main/k/kdenetwork/kdenetwork-dbg_3.5.5-2_i386.deb 2006/11/11 15:01 EST [ThrottlingProtocol,client] [CacheEntry] download_data_end:/var/cache/apt-proxy/debian/pool/main/k/kdenetwork/kdenetwork-dbg_3.5.5-2_i386.deb 2006/11/11 15:01 EST [ThrottlingProtocol,client] [CacheEntry] file_sent:/var/cache/apt-proxy/debian/pool/main/k/kdenetwork/kdenetwork-dbg_3.5.5-2_i386.deb 2006/11/11 15:01 EST [ThrottlingProtocol,client] [CacheEntry] download started:/var/cache/apt-proxy/debian/pool/main/k/kdenetwork/kdenetwork-dbg_3.5.5-2_i386.deb 2006/11/11 15:03 EST [ThrottlingProtocol,client] [CacheEntry] download_data_end:/var/cache/apt-proxy/debian/pool/main/k/kdenetwork/kdenetwork-dbg_3.5.5-2_i386.deb 2006/11/11 15:03 EST [ThrottlingProtocol,client] [CacheEntry] file_sent:/var/cache/apt-proxy/debian/pool/main/k/kdenetwork/kdenetwork-dbg_3.5.5-2_i386.deb 2006/11/11 15:10 EST [ThrottlingProtocol,client] [CacheEntry] download_data_end:/var/cache/apt-proxy/debian/pool/main/k/kdenetwork/kdenetwork-dbg_3.5.5-2_i386.deb 2006/11/11 15:12 EST [-] [CacheEntry] sending file from cache:/var/cache/apt-proxy/debian/pool/main/k/kdenetwork/kdenetwork-dbg_3.5.5-2_i386.deb 2006/11/11 15:12 EST [-] [CacheEntry] transfer_file:/var/cache/apt-proxy/debian/pool/main/k/kdenetwork/kdenetwork-dbg_3.5.5-2_i386.deb 2006/11/11 15:12 EST [Channel,11,192.168.1.23] [CacheEntry] file_sent:/var/cache/apt-proxy/debian/pool/main/k/kdenetwork/kdenetwork-dbg_3.5.5-2_i386.deb As you can see apt-proxy started downloading at 14:34, 14:45, 14:47 and 15:01. All 4 downloads appear to complete, although the last throws an exception. Only the last actually delivered the complete file to aptitude. (In some of the attempts, aptitude timed out waiting for the file to start. In at least one case I quit the download screen, went back to the package selection screen, came back and told aptitude to `go' again.) After the exception, apt-proxy failed to fetch files until restarted. 2006/11/11 15:10 EST [ThrottlingProtocol,client] [CacheEntry] download_data_end:/var/cache/apt-proxy/debian/pool/main/k/kdenetwork/kdenetwork-dbg_3.5.5-2_i386.deb 2006/11/11 15:10 EST [ThrottlingProtocol,client] Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/twisted/application/app.py", line 131, in runReactorWithLogging reactor.run() File "/usr/lib/python2.4/site-packages/twisted/internet/posixbase.py", line 218, in run self.mainLoop() File "/usr/lib/python2.4/site-packages/twisted/internet/posixbase.py", line 229, in mainLoop self.doIteration(t) File "/usr/lib/python2.4/site-packages/twisted/internet/selectreactor.py", line 133, in doSelect _logrun(selectable, _drdw, selectable, method, dict) --- <exception caught here> --- File "/usr/lib/python2.4/site-packages/twisted/python/log.py", line 53, in callWithLogger return callWithContext({"system": lp}, func, *args, **kw) File "/usr/lib/python2.4/site-packages/twisted/python/log.py", line 38, in callWithContext return context.call({ILogContext: newCtx}, func, *args, **kw) File "/usr/lib/python2.4/site-packages/twisted/python/context.py", line 59, in callWithContext return self.currentContext().callWithContext(ctx, func, *args, **kw) File "/usr/lib/python2.4/site-packages/twisted/python/context.py", line 37, in callWithContext return func(*args,**kw) File "/usr/lib/python2.4/site-packages/twisted/internet/selectreactor.py", line 149, in _doReadOrWrite self._disconnectSelectable(selectable, why, method=="doRead") File "/usr/lib/python2.4/site-packages/twisted/internet/posixbase.py", line 250, in _disconnectSelectable selectable.readConnectionLost(f) File "/usr/lib/python2.4/site-packages/twisted/internet/tcp.py", line 391, in readConnectionLost self.connectionLost(reason) File "/usr/lib/python2.4/site-packages/twisted/internet/tcp.py", line 554, in connectionLost Connection.connectionLost(self, reason) File "/usr/lib/python2.4/site-packages/twisted/internet/tcp.py", line 402, in connectionLost protocol.connectionLost(reason) File "/usr/lib/python2.4/site-packages/twisted/protocols/policies.py", line 76, in connectionLost self.wrappedProtocol.connectionLost(reason) File "/usr/lib/python2.4/site-packages/twisted/web/http.py", line 397, in connectionLost self.handleResponseEnd() File "/usr/lib/python2.4/site-packages/twisted/web/http.py", line 403, in handleResponseEnd self.handleResponse(b) File "/usr/lib/python2.4/site-packages/apt_proxy/fetchers.py", line 361, in handleResponse self.download_complete() File "/usr/lib/python2.4/site-packages/apt_proxy/fetchers.py", line 342, in download_complete self.fetcher.download_complete() File "/usr/lib/python2.4/site-packages/apt_proxy/fetchers.py", line 115, in download_complete self.cacheEntry.download_data_end() File "/usr/lib/python2.4/site-packages/apt_proxy/cache.py", line 368, in download_data_end self.streamfile.close_and_rename(self.file_path) File "/usr/lib/python2.4/site-packages/apt_proxy/cache.py", line 518, in close_and_rename os.rename(self.name, new_name) exceptions.OSError: [Errno 2] No such file or directory 2006/11/11 15:12 EST [-] [CacheEntry] sending file from cache:/var/cache/apt-proxy/debian/pool/main/k/kdenetwork/kdenetwork-dbg_3.5.5-2_i386.deb 2006/11/11 15:12 EST [-] [CacheEntry] transfer_file:/var/cache/apt-proxy/debian/pool/main/k/kdenetwork/kdenetwork-dbg_3.5.5-2_i386.deb 2006/11/11 15:12 EST [Channel,11,192.168.1.23] [CacheEntry] file_sent:/var/cache/apt-proxy/debian/pool/main/k/kdenetwork/kdenetwork-dbg_3.5.5-2_i386.deb 2006/11/11 15:21 EST [Channel,12,192.168.1.23] [CacheEntry] start download:pool/main/g/gst-plugins0.8/gstreamer0.8-a52dec_0.8.12-6_i386.deb 2006/11/11 15:21 EST [Channel,12,192.168.1.23] [CacheEntry] start download:pool/main/g/gst-plugins0.8/gstreamer0.8-aa_0.8.12-6_i386.deb 2006/11/11 15:21 EST [Channel,12,192.168.1.23] [CacheEntry] start download:pool/main/g/gst-plugins0.8/gstreamer0.8-alsa_0.8.12-6_i386.deb 2006/11/11 15:21 EST [Channel,12,192.168.1.23] [CacheEntry] start download:pool/main/g/gst-plugins0.8/gstreamer0.8-artsd_0.8.12-6_i386.deb 2006/11/11 15:21 EST [Channel,12,192.168.1.23] [CacheEntry] start download:pool/main/g/gst-plugins0.8/gstreamer0.8-audiofile_0.8.12-6_i386.deb 2006/11/11 15:21 EST [Channel,12,192.168.1.23] [CacheEntry] start download:pool/main/g/gst-plugins0.8/gstreamer0.8-caca_0.8.12-6_i386.deb 2006/11/11 15:21 EST [Channel,12,192.168.1.23] [CacheEntry] start download:pool/main/g/gst-plugins0.8/gstreamer0.8-cdio_0.8.12-6_i386.deb 2006/11/11 15:21 EST [Channel,12,192.168.1.23] [CacheEntry] start download:pool/main/g/gst-plugins0.8/gstreamer0.8-cdparanoia_0.8.12-6_i386.deb 2006/11/11 15:21 EST [Channel,12,192.168.1.23] [CacheEntry] start download:pool/main/g/gst-plugins0.8/gstreamer0.8-dv_0.8.12-6_i386.deb 2006/11/11 15:21 EST [Channel,12,192.168.1.23] [CacheEntry] start download:pool/main/g/gst-plugins0.8/gstreamer0.8-dvd_0.8.12-6_i386.deb 2006/11/11 15:23 EST [Channel,13,192.168.1.23] [CacheEntry] start download:pool/main/g/gst-plugins0.8/gstreamer0.8-a52dec_0.8.12-6_i386.deb 2006/11/11 15:25 EST [-] Received SIGTERM, shutting down. 2006/11/11 15:25 EST [-] (Port 9999 Closed) Andrew V. -- System Information: Debian Release: 4.0 APT prefers testing APT policy: (500, 'testing') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.17-2-686 Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8) Versions of packages apt-proxy depends on: ii adduser 3.99 Add and remove users and groups ii bzip2 1.0.3-6 high-quality block-sorting file co ii debconf [debconf-2.0] 1.5.8 Debian configuration management sy ii logrotate 3.7.1-3 Log rotation utility ii python 2.4.3-11 An interactive high-level object-o ii python-apt 0.6.19 Python interface to libapt-pkg ii python-central 0.5.8 register and build utility for Pyt ii python-twisted-web 0.6.0-1 An HTTP protocol implementation to apt-proxy recommends no packages. -- debconf information: apt-proxy/upgrading-v2: apt-proxy/upgrading-v2-result: