FS#43304 - [makepkg] DLAGENTS parsing/splitting does not respect quote escaping
Attached to Project:
Pacman
Opened by zopieux (Zopieux) - Friday, 02 January 2015, 14:47 GMT
Last edited by Allan McRae (Allan) - Sunday, 31 January 2016, 03:51 GMT
Opened by zopieux (Zopieux) - Friday, 02 January 2015, 14:47 GMT
Last edited by Allan McRae (Allan) - Sunday, 31 January 2016, 03:51 GMT
|
Details
Description:
When downloading, makepkg invokes the dl-agent but shell argument splitting does not respect single quote escaping. Before system upgrade (pacman <4.2.0-5), this used to work fine. Additional info: * core/pacman (for /usr/bin/makepkg) 4.2.0-5 Steps to reproduce: Using the following makepkg.conf configuration: DLAGENTS=( "ftp::/usr/bin/aria2c -U 'Mozilla/5.0 (compatible)' -o %o %u" "http::/usr/bin/aria2c -U 'Mozilla/5.0 (compatible)' -o %o %u" "https::/usr/bin/aria2c -U 'Mozilla/5.0 (compatible)' -o %o %u" 'rsync::/usr/bin/rsync -z %u %o' 'scp::/usr/bin/scp -C %u %o') When strace'ing makepkg on eg. https download, we can see that it invokes the dl-agent with the following: 26946 execve("/usr/bin/aria2c", ["/usr/bin/aria2c", "-U", "'Mozilla/5.0", "(compatible)'", "-o", "pew-0.1.14.tar.gz.part", "https://pypi.python.org/packages/source/p/pew/pew-0.1.14.tar.gz"], [/* 74 vars */]) = 0 Note the wrongly splitted -U argument. It should be ["-U", "Mozilla/5.0 (compatible)"]. As a result, aria2c tries to download the URL "(compatible)", which fails, of course. A possible user fix is to escape spaces using backslashes as in: "https::/usr/bin/aria2c -U Mozilla/5.0\ (compatible) -o %o %u" |
This task depends upon
Closed by Allan McRae (Allan)
Sunday, 31 January 2016, 03:51 GMT
Reason for closing: Fixed
Additional comments about closing: Documented in git commit 18d00097
Sunday, 31 January 2016, 03:51 GMT
Reason for closing: Fixed
Additional comments about closing: Documented in git commit 18d00097
This is the intended solution:
https://projects.archlinux.org/pacman.git/commit/?id=ee207d7c7b34ca