Your message dated Mon, 04 Jun 2007 10:32:02 +0000
with message-id <[EMAIL PROTECTED]>
and subject line Bug#386546: fixed in apt-proxy 1.9.36
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.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: apt-proxy
Version: 1.9.35
Severity: normal
Tags: patch

If you use a browser to go to the root of an apt-proxy installation
(e.g. http://whatever:9999/) then it causes a python exception:


2006/09/08 12:49 BST [Channel,0,127.0.0.1] Traceback (most recent call last):
          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)
        --- <exception caught here> ---
          File 
"/usr/lib/python2.4/site-packages/twisted/internet/selectreactor.py", line 139, 
in _doReadOrWrite
            why = getattr(selectable, method)()
          File "/usr/lib/python2.4/site-packages/twisted/internet/tcp.py", line 
348, in doRead
            return self.protocol.dataReceived(data)
          File "/usr/lib/python2.4/site-packages/twisted/protocols/basic.py", 
line 232, in dataReceived
            why = self.lineReceived(line)
          File "/usr/lib/python2.4/site-packages/twisted/web/http.py", line 
1004, in lineReceived
            self.allContentReceived()
          File "/usr/lib/python2.4/site-packages/apt_proxy/apt_proxy.py", line 
376, in allContentReceived
            http.HTTPChannel.allContentReceived(self)
          File "/usr/lib/python2.4/site-packages/twisted/web/http.py", line 
1045, in allContentReceived
            req.requestReceived(command, path, version)
          File "/usr/lib/python2.4/site-packages/twisted/web/http.py", line 
601, in requestReceived
            self.process()
          File "/usr/lib/python2.4/site-packages/apt_proxy/apt_proxy.py", line 
269, in process
            backend_path = self.uri.split('/',2)[2]
        exceptions.IndexError: list index out of range


Here's a patch which fixes that, and also alters the finishCode()
method to send the error code and message in HTML in the body of the
reply so someone can actually see it in a browser:


--- /usr/share/pycentral/apt-proxy/site-packages/apt_proxy/apt_proxy.py~        
2006-08-14 23:00:45.000000000 +0100
+++ /usr/share/pycentral/apt-proxy/site-packages/apt_proxy/apt_proxy.py 
2006-09-08 13:06:24.000000000 +0100
@@ -264,7 +264,13 @@
 
         log.debug("backend: %s %s" % (self.backend.base, self.backend.uris))
 
-        backend_path = self.uri.split('/',2)[2]
+        elements = self.uri.split('/', 2)
+        if len(elements) < 3:
+            log.debug("abort - too few slashes in URI %s" % (self.uri), 
'Request')
+            self.finishCode(http.FORBIDDEN, 'too few slashes in URI %s' % 
(self.uri))
+            return
+
+        backend_path = elements[2]
         self.cacheEntry = self.backend.get_cache_entry(backend_path)
 
         if not self.cacheEntry.filetype:
@@ -315,7 +321,8 @@
         "Finish the request with a status code and no streamed data"
         log.debug("finishCode: %s, %s" % (responseCode, message), 'Request')
         self.setResponseCode(responseCode, message)
-        self.write("")
+        self.setHeader("content-type", "text/html")
+        self.write("<html><head><title>ERROR %d</title></head><body>ERROR %d - 
%s</body></html>\n" % (responseCode, responseCode, message))
         self.finish()
 
     def finish(self):


Cheers,
Mark.


-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 
'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16-2-686-smp
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)

Versions of packages apt-proxy depends on:
ii  adduser                       3.97       Add and remove users and groups
ii  bzip2                         1.0.3-3    high-quality block-sorting file co
ii  debconf [debconf-2.0]         1.5.3      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.5      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 excluded


--- End Message ---
--- Begin Message ---
Source: apt-proxy
Source-Version: 1.9.36

We believe that the bug you reported is fixed in the latest version of
apt-proxy, which is due to be installed in the Debian FTP archive:

apt-proxy_1.9.36.dsc
  to pool/main/a/apt-proxy/apt-proxy_1.9.36.dsc
apt-proxy_1.9.36.tar.gz
  to pool/main/a/apt-proxy/apt-proxy_1.9.36.tar.gz
apt-proxy_1.9.36_all.deb
  to pool/main/a/apt-proxy/apt-proxy_1.9.36_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Chris Halls <[EMAIL PROTECTED]> (supplier of updated apt-proxy package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [EMAIL PROTECTED])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Mon, 04 Jun 2007 11:06:08 +0100
Source: apt-proxy
Binary: apt-proxy
Architecture: source all
Version: 1.9.36
Distribution: unstable
Urgency: low
Maintainer: Chris Halls <[EMAIL PROTECTED]>
Changed-By: Chris Halls <[EMAIL PROTECTED]>
Description: 
 apt-proxy  - Debian archive proxy and partial mirror builder
Closes: 182855 266000 274679 303357 319005 322242 330492 348985 366262 382078 
386546 387243 393483 397399 397403 398217 404679
Changes: 
 apt-proxy (1.9.36) unstable; urgency=low
 .
   [ Chris Halls ]
   * Merge NMUs by Steinar H. Gunderson, Thomas Huriaux and Steve Langasek.
     Thanks guys! (Closes: #404679)
   * Close a longstanding bug where clients would hang when receiving
     files from the cache. The problem was caused by reusing the same
     file handle for several requests at once.
     (Closes: #274679, #382078, #322242, #397399, #397403, #398217)
   * Change the meaning of min_refresh_delay parameter, so the
     delay is measured from the modification time of the file on the
     backend instead of the time a client last requested this file.
     Now apt-proxy will always query backends when a file is too
     old (Closes: #266000)
   * Set process name to apt-proxy
   * Properly deal with escaped characters, including ~ in URLs on FTP
     backends. Unescape URLs and check for invalid characters when parsing
     a request. A big thanks to Ben Hutchings for the patch
     (Closes: #393483, #366262)
   * Fix [EMAIL PROTECTED] given in backend server URLs and add a test case.
     Thanks Jason Thomas for the patch (Closes: #348985)
   * Fix exception when sending ftp password to backend (Closes: #387243)
   * Remove extra '/' in HTTP GET requests (Closes: #330492)
   * Uncompress Packages.gz and Packages.bz2 on the fly, and
     update databases from these files (Closes: #319005, #303357)
   * Add unit tests for valid URLs containing /../ (Closes: #182855)
   * Remove obsolete GZipFetcher from fetchers.py
 .
   [ Mark Sheppard ]
   * Generate an error if a client attempts to retrieve
     http://server:9999/  (Closes: #386546)
   * When returning an error, generate an HTML page containing the error
Files: 
 a94c54a184f0e6d1ab2b9816df99b63a 726 admin extra apt-proxy_1.9.36.dsc
 a8b6cea540a9b0888dae5d2adad811ef 107319 admin extra apt-proxy_1.9.36.tar.gz
 db6c19bf0482c2a7cef6f9e562876b98 83942 admin extra apt-proxy_1.9.36_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGY+TKexmdExmX588RAti9AJ4xvPtmRRjc4PatmoSrr9DepsWTLwCffpqK
GpPMR+LAX33FZoHHqOsZF44=
=gVmq
-----END PGP SIGNATURE-----


--- End Message ---

Reply via email to