Bug 34000 - Не работают URLы с literal IPv6 адресами в sources.list
Summary: Не работают URLы с literal IPv6 адресами в sources.list
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: apt (show other bugs)
Version: unstable
Hardware: all Linux
: P3 normal
Assignee: Ivan Zakharyaschev
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-12 10:51 MSK by Alexey Vissarionov
Modified: 2025-04-24 10:32 MSK (History)
10 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Vissarionov 2017-10-12 10:51:16 MSK
# cat /etc/apt/sources.list.d/sisyphus-local.list
rpm [alt] http://[::1]/Sisyphus x86_64 classic
rpm [alt] http://[::1]/Sisyphus noarch classic

# apt-get update
Err http://[::1] x86_64 release
  400 Bad Request
Err http://[::1] noarch release
  400 Bad Request
Failed to fetch http://[::1]/Sisyphus/x86_64/base/release  400 Bad Request
Failed to fetch http://[::1]/Sisyphus/noarch/base/release  400 Bad Request

# tail -2 /var/log/nginx/access.log
[12/Oct/2017:10:43:27 +0300] ::1 - - "GET /Sisyphus/x86_64/base/release HTTP/1.1" (http:///Sisyphus/x86_64/base/release) 400 166 ref: "-" uag: "-" for: "-" "acclang: -"
[12/Oct/2017:10:43:27 +0300] ::1 - - "GET /Sisyphus/noarch/base/release HTTP/1.1" (http:///Sisyphus/noarch/base/release) 400 166 ref: "-" uag: "-" for: "-" "acclang: -"

# wget -q -O /dev/null 'http://[::1]/Sisyphus/noarch/base/release'

# tail -1 /var/log/nginx/access.log
[12/Oct/2017:10:46:15 +0300] ::1 - - "GET /Sisyphus/noarch/base/release HTTP/1.1" (http://[::1]/Sisyphus/noarch/base/release) 200 691 ref: "-" uag: "Wget/1.14 (linux-gnu)" for: "-" "acclang: -"
Comment 1 Anton Farygin 2019-09-03 08:55:34 MSK
Воспроизвёл. Лёша, посмотри пожалуйста.
При этом - если dns отдал IPV6 имя, то apt отлично с ним работает.
Опции из Debain Acquire::ForceIPv4=true и Acquire::ForceIPv6=true у нас тоже не работают, кстати.

Для тестирования можно использовать https://download.basealt.ru и его IPv4/IPv6 адреса.
Comment 2 Aleksei Nikiforov 2019-09-04 18:21:10 MSK
Удалось воспроизвести с адресом [::1]. С адресом [2a01:8600:200::11] не воспроизвелось у меня.

$ host download.basealt.space
download.basealt.space has address 176.12.98.77
download.basealt.space has IPv6 address 2a01:8600:200::11
Comment 3 Aleksei Nikiforov 2019-09-05 15:40:52 MSK
Сделал исправление, собрал задание #237148. Нужен аппрув.
Comment 4 Arseny Maslennikov 2025-01-15 17:14:25 MSK
(In reply to Aleksei Nikiforov from comment #3)
> Сделал исправление, собрал задание #237148. Нужен аппрув.

Нет больше такого задания.
Comment 5 Repository Robot 2025-04-24 10:32:28 MSK
apt-0.5.15lorg2-alt92 -> sisyphus:

 Wed Apr 16 2025 Ivan Zakharyaschev <imz@altlinux> 0.5.15lorg2-alt92
 - Support encoded usernames and passwords in URIs (incl. http_proxy); it was
   impossible to have @ there; now one should write %40 (ALT#38277).
 - Get config values with percent (%) correct in methods (e.g., a password as
   above in Acquire::http::Proxy). More generally: for correct decoding,
   do always encode percent (%) when %-encoding strings (in any URIs etc).
 - Backported the fixes from Debian 0.9.8~3 (IPv6 literals; encode passwords):
   + properly escape IP-literals (e.g. IPv6 address) in HTTP requests
     (allows using IPv6 numeric addresses in sources.list) (ALT#34000);
   + %-encode username and password when writing URIs (doesn't help alone with
     reading URIs as in the case of http_proxy above, but normalizes output);
   + include port in shortened URIs (e.g. with apt-cache policy).
 - testcases: Multiplied http-related ones to test these kinds of connections.
 - Some HTTP tweaks from Debian:
   + quote spaces ( ) and plus (+) in filenames (0.9.8~48);
   + do not send keep-alive (HTTP/1.1 default) (0.9.9.3~4^2).