Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#70130 - [devtools] arch-nspawn does not properly sanitize local repo locations wrt cache file locations

Attached to Project: Arch Linux
Opened by Gunnar Bretthauer (Taijian) - Monday, 22 March 2021, 21:49 GMT
Last edited by Andreas Radke (AndyRTR) - Wednesday, 24 March 2021, 12:50 GMT
Task Type Bug Report
Category Arch Projects
Status Assigned
Assigned To Christian Hesse (eworm)
Levente Polyak (anthraxx)
Eli Schwartz (eschwartz)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No



When arch-nspawn parses local repo locations in pacman.conf within the chroot and then decides whether to add them to the CacheDir array in the 'new' pacman.conf, it does not properly sanitize inputs - or, put another way, it is inconsistent with the default entry for CacheDir within pacman.conf in it's handling of paths.

I have in my pacman.conf the following lines:

CacheDir = /var/cache/pacman/pkg/ /var/cache/pacman/aur/
Server = file:///var/cache/pacman/aur

This corresponds to my local package cache for AUR packages. Now, when arch-nspawn parses my pacman.conf, it does not recognize that the CacheDir entry and the repo location are identical, leading it to add the location to the CacheDir line again.
New pacman.conf:

CacheDir = /var/cache/pacman/pkg/ /var/cache/pacman/aur/ /var/cache/pacman/aur

Sanitizing trailing slashes could fix that.

Steps to reproduce:
* Have entries like the above in pacman.conf
* invoke arch-nspawn
* check pacman.conf inside the chroot
This task depends upon