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 Kristian (klausenbusk) - Saturday, 03 June 2023, 18:05 GMT
Task Type Bug Report
Category Arch Projects
Status Closed
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 100%
Votes 0
Private No

Details

Description:

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/
[local_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

Closed by  Kristian (klausenbusk)
Saturday, 03 June 2023, 18:05 GMT
Reason for closing:  Upstream
Additional comments about closing:  Please report upstream if still relevant: https://gitlab.archlinux.org/archlinux/d evtools.

Loading...