Your message dated Sat, 11 Sep 1999 23:05:19 -0400
with message-id <[EMAIL PROTECTED]>
and subject line Bug#44811: search_packages.pl creates bogus links
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'm
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Ian Jackson
(administrator, Debian bugs database)

Received: (at submit) by bugs.debian.org; 10 Sep 1999 19:14:32 +0000
Received: (qmail 24448 invoked from network); 10 Sep 1999 19:04:50 -0000
Received: from pop3-3.enteract.com (207.229.143.32)
  by master.debian.org with SMTP; 10 Sep 1999 19:04:50 -0000
Received: (qmail 81857 invoked from network); 10 Sep 1999 19:04:29 -0000
Received: from shell-3.enteract.com ([EMAIL PROTECTED])
  by pop3-3.enteract.com with SMTP; 10 Sep 1999 19:04:29 -0000
Date: Fri, 10 Sep 1999 14:04:29 -0500 (CDT)
From: Klaus Weide <[EMAIL PROTECTED]>
Reply-To: Klaus Weide <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: search_packages.pl creates bogus links
Message-ID: <[EMAIL PROTECTED]>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

Package: www.debian.org
Version: N/A

Apparently the script invoked by (for example)

  <http://cgi.debian.org/cgi-bin/search_packages.pl?keywords=lynx&;
   searchon=names&version=all&release=all>

uses the Referer HTTP header, if it is being sent, to construct
the links in the returned page.  I assume this is meant to point
the reader back at the right Web page mirror, like www.us.debian.org,
www.de.debian.org, etc.  But Referer-based navigation is fundamentally
unreliable.

For demonstration, I created a local file ~/lynx_bookmarks-copy.html,
(I) with a link to the above URL.  Following this link using lynx [*]
results in what looks at first like the usual Search Results page, but
with all the links wrong.  For example, what should have been a link to

  <http://www.debian.org/Packages/stable/web/lynx.html>

is instead a link to

  <file://localhost/home/kweide/lynx_bookmarks-copy.html/Packages/stable/
   web/lynx.html>.

(II) By using a link to <http://packages.debian.org/lynx/> instead,
which redirects to the long URL above, I get the same result as above.

(III) In some situations lynx can send a completely unreleted Referer,
when returning with Left Arrow to a document that has dropped out of
its cache of rendered documents.


Relying on Referer for correct links is a Bad Idea in general.
You should at least check the header value for plausibility.
It probably should match "http://*.debian.org/* or something like
that.  If the string doesn't look right, do the same thing you do
when Referer is absent.

Or you could somehow pass through the hostname as part of
the URL query string, at least in some situations.


[*] III can be argued to be misbehavior on lynx's part.  I believe it
is acting correctly for I and II.
Note I had to put the links into a file not recognized as a bookmark
file, and make sure the -nofilereferer option (or its lynx.cfg
equivalent) is not set, for lynx to send Referer.  This is not material
to the point, no such steps would be necessary to demonstrate the
problem if I chose to access the file via an http (or ftp,...) URL.

   Klaus

Reply via email to