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

Bug#358931: Invalid entries in sources.list not recognized



Hi!

So while approx may not recognize full URIs, the problem at hand was in
apt not reporting sources.list line as incorrect. Bug reassigned.

It seems that this ticket is related to how malformed URLs from sources.list
are parsed. I have testes the behaviour of apt 3.0.2 from trixie/sid.




A. Info about a test machine

root@debian:~# grep CODENAME /etc/os-release
VERSION_CODENAME=trixie

root@debian:~# apt --version
apt 3.0.2 (amd64)

root@debian:~# cat /etc/apt/sources.list | grep -v "#"
deb [trusted=yes] http://proxy:9999.creditreform.bg/12 ./




B. Test with "proxy" host not available

root@debian:~# apt-get -o "Debug::Acquire::http=true" update
Ign:1 http://proxy:9999/12 ./ InRelease
Ign:1 http://proxy:9999/12 ./ InRelease
Ign:1 http://proxy:9999/12 ./ InRelease
Err:1 http://proxy:9999/12 ./ InRelease
  Could not resolve 'proxy'
Reading package lists... Done
W: Failed to fetch http://proxy:9999/12/./InRelease  Could not resolve 'proxy'
W: Some index files failed to download. They have been ignored, or old ones used instead.




C. Test with "proxy" host available in local network. The host is running
a http server that listens on port 9999.

root@debian:~# grep proxy /etc/hosts
10.0.0.237 proxy

root@debian:~# ip --brief addr
lo               UNKNOWN        127.0.0.1/8 ::1/128
ens3             UP             10.0.0.57/8 fe80::201:2ff:fe01:202/64

root@debian:~# apt-get -o "Debug::Acquire::http=true" update
0% [Working]GET /12/./InRelease HTTP/1.1
Host: proxy:9999
Cache-Control: max-age=0
Accept: text/*
User-Agent: Debian APT-HTTP/1.3 (3.0.2)


Answer for: http://proxy:9999/12/./InRelease
HTTP/1.1 404 Not Found
Server: nginx/1.22.1
Date: Sat, 07 Jun 2025 13:22:33 GMT
Content-Type: text/html
Content-Length: 153
Connection: keep-alive

Ign:1 http://proxy:9999/12 ./ InRelease
0% [Working]GET /12/./Release HTTP/1.1
Host: proxy:9999
Cache-Control: max-age=0
Accept: text/*
If-Modified-Since: Tue, 08 Apr 2025 18:11:40 GMT
User-Agent: Debian APT-HTTP/1.3 (3.0.2)


Answer for: http://proxy:9999/12/./Release
HTTP/1.1 304 Not Modified
Server: nginx/1.22.1
Date: Sat, 07 Jun 2025 13:22:33 GMT
Last-Modified: Tue, 08 Apr 2025 18:11:40 GMT
Connection: keep-alive
ETag: "67f566dc-e4"

Hit:2 http://proxy:9999/12 ./ Release
0% [Working]GET /12/./Release.gpg HTTP/1.1
Host: proxy:9999
User-Agent: Debian APT-HTTP/1.3 (3.0.2)


Answer for: http://proxy:9999/12/./Release.gpg
HTTP/1.1 404 Not Found
Server: nginx/1.22.1
Date: Sat, 07 Jun 2025 13:22:33 GMT
Content-Type: text/html
Content-Length: 153
Connection: keep-alive

Ign:3 http://proxy:9999/12 ./ Release.gpg
Reading package lists... Done




My understanding is that apt's parser doesn't recognize the dot after
"9999" as a character that is unexpected at this position (after a port
number), and instead it discards everything after the port number,
until a first '/' character.

Kamil


Reply to: