summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2020-06-18libalpm: fix alpm_option_set_assumeinstalledmorganamilo1-0/+1
It looks like this function has never actually worked. The current list is never set to NULL after being freed. So the new deps were just appended to the already freed list, leading to a segfault. Signed-off-by: Allan McRae <allan@archlinux.org> (cherry picked from commit 0a25548cd0910f66dea2dfab21f75a6d15366d64)
2020-06-18makepkg: make per-package files containing '$pkgname' consistently workEli Schwartz3-9/+21
Extracting function variables containing arbitrarily scoped variables of arbitrary nature is a disaster, but let's at least cover the common case of using the actual '$pkgname' in an install/changelog file. It's the odd case of actually being basically justified use of disambiguating between the same variable used in multiple different split packages... and also, --printsrcinfo already uses and overwrites the variable 'pkgname' in pkgbuild_extract_to_srcinfo, so this "works" in .SRCINFO but doesn't work in .src.tar.gz It doesn't work in lint_pkgbuild either, but in that case the problem is being too permissive, not too restrictive -- we might end up checking the same file twice, and printing that it is missing twice. Fixes FS#64932 Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org> (cherry picked from commit d626a17ef94d79975ff17d04250152ea46aaade3)
2020-06-18Fix "pacman -U <url>" operationsAllan McRae1-1/+1
Commit e6a6d307 detected complete part files by comparing a payload's max_size to initial_size. However, these values are also equal when we use pacman -U on a URL as max_size is set to 0 in that case. Add a further condition to avoid that. Signed-off-by: Allan McRae <allan@archlinux.org> (cherry picked from commit e54617c7d554e0c14c039432b5f7bef66e43769c)
2020-06-18Increase maximum database sizeAllan McRae1-2/+2
We previously has the maximum database size as 25MB. This was set in the days before repos had as many packages as they do now, and before we started distributing files databases. Increase this limit to 128MB. Signed-off-by: Allan McRae <allan@archlinux.org> (cherry picked from commit 2856a7dea3c0d4584e126b5ca5957e13e23f83d1)
2020-06-18Remove unneeded ltmain patchAllan McRae2-34/+0
Many moons ago, libtool was bad - I mean worse than today! It gobbled all --as-needed and we ended up with an overlinked libalpm. This was annoying, particularly when dealing with soname bumps in libraries pacman/libalpm had no business linking to. Luckily we had a fix, stolen from GNOME I believe. And with that fix, we lived in harmony with libtool for many years. Until one day, unbeknownst to us, libtool was "fixed". We kept applying our patch, because it still applied, but it did worse than nothing. It gobbled up our other LDFLAGS, and our libalpm started missing out on RELRO and BIND_NOW. This made the Arch Security Team unhappy. We will make them happy again by stopping the patch. Signed-off-by: Allan McRae <allan@archlinux.org> (cherry picked from commit 2e32d51a262fef398a94a17c0a0d4ff3233990b5) [Andrew: restore autogen.sh]
2020-06-18Handle .part files that are the size of the correct packageAllan McRae2-2/+18
In rare cases, likely due to a well timed Ctrl+C, but possibly due to a broken mirror, a ".part" file may have size at least that of the correct package size. When encountering this issue, currently pacman fails in different ways depending on where the package falls in the list to download. If last, "wrong or NULL argument passed" error is reported, or a "invalid or corrupt package" issue if not. Capture these .part files, and remove the extension. This lets pacman either use the package if valid, or offer to remove it if it fails checksum or signature verification. Signed-off-by: Allan McRae <allan@archlinux.org> (cherry picked from commit e6a6d3079315ce722fec39604fddbab1c7ac79b3)
2020-06-18libalpm/sync.c: Do not download missing keys multiple timesAllan McRae1-2/+10
We now store key structs of our missing key info, so can not search the list for string matches. This caused missing keys to be downloaded once for every package they signed. Signed-off-by: Allan McRae <allan@archlinux.org> (cherry picked from commit 540b19164b1ab3a4950b4a828fb90d047f4a591d)
2020-01-14makepkg: fix regression that broke extraction of file:// sourcesEli Schwartz2-3/+3
In commit 9c817b654996249b8022e189ee7e2692f4668431 we made these sources extendable, and heuristically determined the correct extraction functions to use. But our fallback for protos that didn't have an exact extract_* function didn't take into account that 'extract_file' matches an actual proto... so we passed the netfile in while the function expected a file. Solution: the function should expect a netfile too, thereby allowing us to delay an attempted resolution of netfile -> file, to the one case where it is actually used. This makes us slightly more efficient in the non-file case, makes our functions a bit more consistent, and makes file:// extraction work again. Fixes FS#64648 Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org> (cherry picked from commit 349c22d043290ccd0cce9f30981f5415e295442a)
2020-01-14Dereference double pointer before assigning NULLDaniel T. Borelli1-2/+2
Daniel T. Borelli <danieltborelli@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> (cherry picked from commit eaa2770c80f8f3b168b99021e4258d696523d38a)
2020-01-10makepkg: fix one more file-seccomp issueEli Schwartz1-1/+1
When file is called via fakeroot, it doesn't matter whether you use -z or not, it is still incompatible with seccomp. Fix by configuring it with FILECMD when used in the fakeroot 'tidy' run. Fixes FS#65100 Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
2020-01-10pactest: set package tar format to GNU_FORMATAllan McRae1-1/+1
python-3.8 changed the default tar format to PAX_FORMAT. This caused issues in our testsuite with package extraction of files with UTF-8 characters as we run the tests under the C locale. sycn600.py: error: error while reading package /tmp/pactest-xuhri4xa/var/cache/pacman/pkg/unicodechars-2.0-1.pkg.tar.gz: Pathname can't be converted from UTF-8 to current locale. Set format back to GNU_FORMAT. Signed-off-by: Allan McRae <allan@archlinux.org> (cherry picked from commit b9faf652735c603d1bdf849a570185eb721f11c1)
2019-11-01Release 5.2.1v5.2.1Allan McRae3-4/+5
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-11-01Pull latest translations from TransifexAllan McRae42-104/+133
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-11-01Update NEWS for pacman-5.2.1Allan McRae1-0/+11
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-30Comma failAllan McRae1-1/+1
2019-10-30autotools: be more templated when getting list of doc dist filesEli Schwartz1-13/+2
Distribute asciidoc sources for all manpages instead of remembering to add files to both variables. Fixes regression in 377d47142f7aaa01ca782e6587f2d4caf663865b which broke building the website from a dist tarball: make: *** No rule to make target 'pacman-conf.8.html', needed by 'html'. Stop. (Technically this regression is already fixed by commit 942b909829d529409216939b36af11e8480726f5, but this is just going to keep happening, I suspect, so we should fix the root cause.) Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-30makepkg: only run --clean actions if we built a packageEli Schwartz1-1/+1
Fixes issue where users were allowed to run cleanup while running --geninteg or --printsrcinfo or --packagelist, thus mixing invalid responses into stdout. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-30makepkg: do not count hard links multiple times when calculating pkg sizeEli Schwartz4-1/+44
Exclude files with hardlinks when cat'ing all the files, and do a second run to look at each file with hardlinks, keep track of the ones we've already operated on, and only cat each inode once. Then use "wc -c" to get the size of all (deduplicated) files the same way we were already doing. Original-patch-by: Ronan Pigott <rpigott@berkeley.edu> Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-30makepkg: protect against unexpected whitespace in filenamesEli Schwartz4-11/+11
zipman: read -r protects against those evil manpages whose filenames contain backslash escapes, (muahahaha?) IFS= read protects against filenames with: - leading whitespace (but no one is actually stupid enough to configure their MAN_DIRS=() in makepkg.conf with such silly directories, *right*?) - trailing whitespace (but likewise, no one should be stupid enough to write an uncompressed manpage for section '1 ' or something) Also fix several other cases where we read filenames without protecting against surrounding whitespace, or without using null-delimited filenames when we could trivially do so. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-30meson: fix inodecmd for darwin/bsdEli Schwartz1-2/+2
The BSD stat command uses %N, not %n, and was incorrectly ported to meson. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-27Fix segfault importing PGP key for pacman -U operationsAllan McRae1-2/+2
Use after free. Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-24Add pacman-conf(8) to the documentation indexEvangelos Foutras1-0/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-23Update copyright yearsAllan McRae176-182/+182
make update-copyright OLD=2018 NEW=2019 Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-23Remove --force from completionAllan McRae2-4/+2
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-23Update completion for -F changesAllan McRae2-4/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-22makepkg: don't warn when PACKAGER is unsetmorganamilo1-1/+1
makepkg now complains when PACKAGER is not in the format "name <email>". Hide this warning when PACKAGER is unset but still warn if it is set to something out of format. Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-22Fix compression of package databases with zstdNick Cao1-6/+6
Commit 7afe51171 attempted to add zstd compression support to repo-add, but failed... FS#64213 Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-22Fix distribution of meson filesAllan McRae2-1/+4
Also caught the source of a man page not being distributed. Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-21Release v5.2.0v5.2.0Allan McRae3-6/+8
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-21Final translation updates for pacman-5.2.0Allan McRae123-939/+2674
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-17document changes between 5.1 and 5.2Eli Schwartz1-0/+116
Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
2019-10-15Update README for pacman 5.2.0 releaseAllan McRae1-0/+25
This is the first major release without any additions to the libalpm API! Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-15libalpm: set errno in signing dummy functionsmorganamilo1-3/+6
This allows pacman to print the correct error message when checking keys and libalpm has been compiled without gpgme support. Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-15libalpm: fix segfault when -Qip'ing a packagemorganamilo1-1/+2
The dummy checksigs function never sets count to 0, leaving it unitialized. This caused the siglist cleanup to try and free the empty list. Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-14Translation updatesAllan McRae126-10098/+6303
Pull all translations with >75% completion. Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-14remove: improve broken dependency error messageAndrew Gregory1-2/+2
This message was clarified for sync operations in 2b1b7b70753eb56bee08cd270efc7cfa342bc0ec. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-13pacman: return 1 when -F <target> has no resultsmorganamilo1-2/+2
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-12run XferCommand via execAndrew Gregory4-19/+117
system() runs the provided command via a shell, which is subject to command injection. Even though pacman already provides a mechanism to sign and verify the databases containing the urls, certain distributions have yet to get their act together and start signing databases, leaving them vulnerable to MITM attacks. Replacing the system call with an almost equivalent exec call removes the possibility of a shell-injection attack for those users. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2019-10-12add arg_to_string helperAndrew Gregory3-21/+29
Converts an argc/argv pair to a string for presentation to the user. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2019-10-12move wordsplit into common for sharingAndrew Gregory3-116/+118
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2019-10-09makepkg: do not save fflags when creating packagesEli Schwartz1-2/+2
Saving fflages breaks reproducible builds due to encoding information specific to the filesystem that was used to build the package. This information is not needed for packaging purposes anyway. Including fflags also means that attempting to extract a package file as root (or fakeroot) might result in angry warnings being printed to the console by bsdtar, followed by a non-zero exit code, unless the user remembers to use --no-fflags during extraction. This is unpleasant UI, even if pacman itself won't care about these. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-09signing: handle unknown uid in key importChristian Hesse1-0/+5
With unknown uid pacman crashed. Return with error from email_from_uid() if uid is NULL. Signed-off-by: Christian Hesse <mail@eworm.de> Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-09signing: modify question text with unknwon uidChristian Hesse1-2/+8
If the key's uid is unknown (for example with db signatures) the question was: :: Import PGP key 02FD1C7A934E614545849F19A6234074498E9CEE, "(null)"? [Y/n] Let's display a modified question for unknown uid. Signed-off-by: Christian Hesse <mail@eworm.de> Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-07pacman-key: receive keys from WKD with -r/--recv-keysJonas Witschel1-8/+17
If an email address is specified, we use --locate-key to look up the key using WKD and keyserver as a fallback. If the key is specified as a key ID, this doesn't work, so we use the normal keyserver-based --recv-keys. Note that --refresh-keys still uses the keyservers exclusively for refreshing, though the situation might potentially be improved in a new version of GnuPG: https://lists.gnupg.org/pipermail/gnupg-users/2019-July/062169.html Signed-off-by: Jonas Witschel <diabonas@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-07Pull and push translation changes in preparation for 5.2Allan McRae126-17478/+17859
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-07makepkg: propagate E_REMOVE_BUILD_DEPSAlad Wenter1-1/+5
remove_deps is called once, at the end of clean_up() before makepkg exit. If remove_deps returns >0 (e.g. when pressing "n" in the resulting prompt), the error is caught by the ERR signal handler. This in turns sends SIGUSR1 to the process group, with resulting exit code 138. In case remove_deps fails, this patch exits makepkg with E_REMOVE_DEPS if there was no previous error (that is, EXIT_CODE equals E_OK). Otherwise, makepkg exits with EXIT_CODE. Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-07makepkg: remove makedepends before installing built packageErich Eckner1-0/+3
When running `makepkg -i` it may be necessary to first remove make- and checkdepends before installing the built package - for example if they conflict each other. This is the case for wireguard-arch which makedepends and conflicts wireguard-dkms. Signed-off-by: Erich Eckner <git@eckner.net> Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-07makepkg: wait for process to finishAllan McRae1-1/+1
Without the -f option to wait, we might move on and try to delete the logpipe before the process is completed. Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-07makepkg: Delete logpipe when exitingAustin Lund1-3/+4
The logpipe fifo can remain when exiting on a non-error condition such as recieving signals INT and USR1. This can be seen by doing either a manual CTRL-C to interrupt the build or by sending a signal such as: $ makepkg & sleep 5 ; kill -USR1 $! Remove the fifo in all cases on script exit if it still exists. Signed-off-by: Austin Lund <austin.lund@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-07pacman: speed up deptestmorganamilo1-1/+3
Try and find an exact match via pkgcache before iterating the entire localdb. Gives a noticeable speed up for exact matches e.g. `pacman -T zlib` Signed-off-by: Allan McRae <allan@archlinux.org>