apt downloads new repositories with “If-Modified-Since: Tue, 09 Jun 1931 07:27:48 GMT”
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Binary package hint: apt
When apt downloads package information from a new repository, it sends an If-Modified-Since header from 1931:
GET /apt/dists/
Host: debathena.mit.edu
Connection: keep-alive
Cache-Control: max-age=0
If-Modified-Since: Sun, 07 Jun 1931 07:40:36 GMT
User-Agent: Debian APT-HTTP/1.3 (0.8.13ubuntu2)
which is so far in the past as to trigger bugs in some date parsing implementations, such as Perl’s Date::Parse:
$ perl -MDate::Parse -e 'print str2time("Sun, 07 Jun 1931 07:40:36 GMT")'
1938584436
$ perl -MPOSIX -e 'print strftime("%a, %d %b %Y %T %z", gmtime(
Sat, 07 Jun 2031 07:40:36 -0400
If apt does not have a copy of the file yet, it should send no If-Modified-Since header at all, instead of one that’s far in the past.
ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: apt 0.8.13ubuntu2
ProcVersionSign
Uname: Linux 2.6.38-7-generic x86_64
NonfreeKernelMo
Architecture: amd64
Date: Tue Mar 29 04:12:36 2011
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Alpha amd64 (20101202)
ProcEnviron:
LANGUAGE=en_US:en
PATH=(custom, user)
LANG=en_US.utf8
SHELL=/bin/bash
SourcePackage: apt
UpgradeStatus: No upgrade log present (probably fresh install)
Related branches
Changed in apt (Ubuntu): | |
status: | New → In Progress |
importance: | Undecided → Medium |
I looked at method/http.cc and there is a check for last modified to be 0 or not:
if (Itm->LastModified != 0) Buf,"If- Modified- Since: %s\r\n" ,TimeRFC1123( Itm->LastModifi ed).c_str( ));
{
sprintf(
Req += Buf;
}
I guess that the LastModified field is not correctly initialized, as this changelog entry states it has been fixed:
apt (0.7.7) unstable; urgency=low
...
* methods/https.cc:
- only send LastModified if we actually have a file