summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* sideload-repos-systemd: Use systemd-tmpfilesfix-sideload-repos-dirPhaedrus Leeds2020-09-113-18/+6
| | | | | | | | | | | | | | Instead of using a systemd service to create the directory we need for sideloading (/run/flatpak/sideload-repos), use a systemd-tmpfiles conf file. This is more elegant, and the service also had a bug which meant it would create a "/run/flatpak;" directory instead of the one intended. Since systemd-tmpfiles-setup.service runs before sysinit.target and path units are run after sysinit.target, the tmp directory should be in place when flatpak-sideload-usb-repo.path runs in the systemd user instance. Endless OS already has a file at /lib/tmpfiles.d/flatpak.conf, so we can't use that filename.
* Merge pull request #3837 from scootergrisen/patch-3Phaedrus Leeds2020-09-091-655/+506
|\ | | | | Update danish translation
| * Update danish translationscootergrisen2020-09-061-655/+506
| |
* | Merge pull request #3844 from yurchor/uk_update3Phaedrus Leeds2020-09-091-328/+372
|\ \ | | | | | | Update Ukrainian translation
| * | Update Ukrainian translationYuri Chornoivan2020-09-091-328/+372
| |/
* | Merge pull request #3832 from ktosiek/flatpak-enter-dbus-addressPhaedrus Leeds2020-09-091-2/+2
|\ \ | |/ |/| Fix DBUS_*_BUS_ADDRESS in flatpak enter
| * Fix DBUS_*_BUS_ADDRESS in flatpak enterTomasz Kontusz2020-09-041-2/+2
|/ | | | Fixes #3820.
* Merge pull request #3829 from milotype/milotype20200903Phaedrus Leeds2020-09-031-353/+386
|\ | | | | Update Croatian
| * Update Croatianmilotype2020-09-031-353/+386
|/ | | | - update is based upon the current .pot file at: https://l10n.gnome.org/vertimus/flatpak/master/po/hr/
* installation: Clarify that SDKs aren't considered usedPhaedrus Leeds2020-08-311-2/+2
| | | | | | | | | | | | The docs claimed that SDK runtimes are considered used even if there is no app using them or runtime for which they are the SDK, but the implementation does not match that. We could change the implementation to always consider SDK runtimes used, but that would be problematic because some apps use an SDK as their runtime, and in that case the runtime would persist forever after the app is uninstalled, instead of eventually being garbage collected by the subsequent commits to this one.
* app: Make mask and pin output more machine readablePhaedrus Leeds2020-08-312-4/+8
| | | | | This way we can use "wc -l" in the tests to check how many masks/pins there are.
* uninstall: Note pinned runtimes in --unused outputPhaedrus Leeds2020-08-313-2/+78
| | | | | | | | | When "flatpak uninstall --unused" is run, we don't remove unused runtimes that are pinned. List them in the output so the user knows they are being left installed. This commit also adds new library API, flatpak_installation_list_pinned_refs().
* Automatically pin explicitly installed runtimesPhaedrus Leeds2020-08-318-126/+197
| | | | | | | | | | If a runtime is installed explicitly rather than as a dependency, pin it so it doesn't get automatically removed when unused runtimes are being removed. We do this because the runtime might be installed for development or other uses. This commit also rearranges some code in the mask and pin commands, and adds a unit test.
* Minor fixes for mask commandPhaedrus Leeds2020-08-312-8/+4
|
* Add pin command to keep unused runtimesMatthew Leeds2020-08-3115-10/+472
| | | | | | | | | | | | As discussed here [1], we want a way to mark runtimes to be kept even when they are unused by any apps and we are removing such runtimes. Currently this is a command that can be run manually; a subsequent commit will pin runtimes automatically if they are installed independently of any app. A unit test is included. [1] https://github.com/flatpak/flatpak/issues/2639#issuecomment-662311756
* testlibrary: Remove unused variablePhaedrus Leeds2020-08-311-1/+0
|
* transaction: Remove an unused error parameterPhaedrus Leeds2020-08-311-11/+2
|
* transaction: Fix ordering of runtime uninstallationPhaedrus Leeds2020-08-311-1/+1
| | | | | In case a transaction is uninstalling both an app and its runtime, properly ensure the app is uninstalled first.
* testlibrary: Add missing return value checksPhaedrus Leeds2020-08-311-4/+4
|
* dir: Fix a typo of .changedPhaedrus Leeds2020-08-311-1/+1
|
* doc/update: Fix formattingPhaedrus Leeds2020-08-311-1/+1
|
* tests: Expand exports test coverageSimon McVittie2020-08-281-0/+207
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* context: Implement MODE_NONE in unparse_filesystem_flagsSimon McVittie2020-08-281-4/+5
| | | | | | | | | flatpak doesn't yet use -Wswitch-enum, but perhaps it should at some point. Now that FLATPAK_FILESYSTEM_MODE_NONE is a member of the enum, it should be handled; and if we're doing that, we might as well make the same function fully responsible for it. Signed-off-by: Simon McVittie <smcv@collabora.com>
* tests: Exercise flatpak_context_save_metadataSimon McVittie2020-08-281-1/+170
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* tests: Use a temporary HOME directory to test contexts and exportsSimon McVittie2020-08-271-28/+115
| | | | | | | This gives us control over the paths that get shared (or not) and whether they are symlinks, so that we can expand coverage later. Signed-off-by: Simon McVittie <smcv@collabora.com>
* context: Normalize home/path to ~/path, and ~ to homeSimon McVittie2020-08-273-0/+39
| | | | | | | | Historically we didn't accept them, but there's no real reason why not. They're normalized to the form in which earlier Flatpak releases would want to see them. Signed-off-by: Simon McVittie <smcv@collabora.com>
* context: Forbid --filesystem=/Simon McVittie2020-08-272-0/+14
| | | | | | | | Making it an equivalent of --filesystem=host would be misleading, because it wouldn't do what you'd think it does: host mounts some host system directories in their usual places, but others below /run/host. Signed-off-by: Simon McVittie <smcv@collabora.com>
* context: Do some syntactic normalization on filesystemsSimon McVittie2020-08-272-0/+49
| | | | | | | | | | | | | Paths containing ".." are rejected: they're almost certainly a terrible idea. Paths containing "." or multiple slashes are syntactically normalized. This assumes that nobody is going to use "--filesystem=/foo/bar/" to mean "make /foo/bar available, unless it's a non-directory, in which case fail". Signed-off-by: Simon McVittie <smcv@collabora.com>
* tests: Add basic unit tests for FlatpakExports, FlatpakContextSimon McVittie2020-08-272-1/+486
| | | | | | | | | There's a limit to how many assertions we can make here right now, because what we do here is very dependent on the "shape" of the host filesystem. This could be extended in future by using a mock home directory whose contents we control. Signed-off-by: Simon McVittie <smcv@collabora.com>
* context: Expose flatpak_context_parse_filesystem for testingSimon McVittie2020-08-272-1/+6
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* exports: Add assertions to distinguish between mode representationsSimon McVittie2020-08-272-0/+37
| | | | | | | | | When we're talking about a "mode", sometimes we mean a FlatpakFilesystemMode, sometimes we mean a FlatpakFilesystemMode that must be strictly greater than NONE, and sometimes we're willing to accept the FAKE_MODE constants too. Signed-off-by: Simon McVittie <smcv@collabora.com>
* context: Only parse filesystem/mode strings in one placeSimon McVittie2020-08-273-49/+53
| | | | | | | This gives us the ability for the parse function (the former verify function) to carry out a normalization step as well. Signed-off-by: Simon McVittie <smcv@collabora.com>
* tests: Test container-manager interfaceSimon McVittie2020-08-271-1/+9
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* run: Tell processes in container that the container manager is FlatpakSimon McVittie2020-08-271-0/+11
| | | | | | | | | | | https://systemd.io/CONTAINER_INTERFACE/ describes a generic way to tell programs and libraries that they are running in a container: set pid 1's ${container} to the name of the container manager in lower case, and populate /run/host/container-manager with the same string followed by a newline. Let's be nice to application code by doing that, instead of requiring it to look at /.flatpak-info. Signed-off-by: Simon McVittie <smcv@collabora.com>
* Merge pull request #3809 from alexlarsson/valgrind-ciPhaedrus Leeds2020-08-242-4/+59
|\ | | | | CI: Add a valgrind check
| * CI: Add a valgrind checkAlexander Larsson2020-08-241-4/+50
| | | | | | | | | | | | | | | | | | This takes a long time, but doesn't have to be mandatory, also we only run it if the regular make check passes. Removes some old no-longer needed ci config workaround. The new test uses ubuntu-20.04 so we get wider distro testing.
| * tests: Add ostree ioctl valgrind suprressionAlexander Larsson2020-08-241-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I was getting this in the CI: --30631-- WARNING: unhandled amd64-linux syscall: 315 --30631-- You may be able to write your own handler. --30631-- Read the file README_MISSING_SYSCALL_OR_IOCTL. --30631-- Nevertheless we consider this a bug. Please report --30631-- it at http://valgrind.org/support/bug_reports.html. runtime/org.test.Platform/x86_64/stable: 13b73140218edd02a9d18bc178af1a3ad0203049f9f1ad8c51c62b3ee5f1acd9 ==30631== Syscall param ioctl(generic) points to unaddressable byte(s) ==30631== at 0x53A437B: ioctl (syscall-template.S:78) ==30631== by 0x4B4456E: ??? (in /usr/lib/x86_64-linux-gnu/libostree-1.so.1.0.0) ==30631== by 0x4B466FB: ??? (in /usr/lib/x86_64-linux-gnu/libostree-1.so.1.0.0) ==30631== by 0x4B48F29: ostree_repo_write_content (in /usr/lib/x86_64-linux-gnu/libostree-1.so.1.0.0) ==30631== by 0x1D9161: flatpak_mtree_create_symlink (in /home/runner/work/flatpak/flatpak/_build/flatpak) ==30631== by 0x1DF95B: flatpak_repo_generate_appstream (in /home/runner/work/flatpak/flatpak/_build/flatpak) ==30631== by 0x157870: flatpak_builtin_build_update_repo (in /home/runner/work/flatpak/flatpak/_build/flatpak) ==30631== by 0x135793: main (in /home/runner/work/flatpak/flatpak/_build/flatpak) ==30631== Address 0xe is not stack'd, malloc'd or (recently) free'd ==30631== { <insert_a_suppression_name_here> Memcheck:Param ioctl(generic) fun:ioctl obj:/usr/lib/x86_64-linux-gnu/libostree-1.so.1.0.0 obj:/usr/lib/x86_64-linux-gnu/libostree-1.so.1.0.0 fun:ostree_repo_write_content fun:flatpak_mtree_create_symlink fun:flatpak_repo_generate_appstream fun:flatpak_builtin_build_update_repo fun:main }
* | flatpak-dir: Pass cached summary{,.sig} to OSTreePhilip Withnall2020-08-241-1/+10
| | | | | | | | | | | | | | | | | | | | | | This allows OSTree to avoid re-checking the `summary.sig` for freshness once per pull in a transaction, since flatpak has already done that. This avoids latency in a transaction (especially on high latency or lossy network connections) and avoids the potential race condition of the `summary` file changing on the server part-way through a transaction. Signed-off-by: Philip Withnall <withnall@endlessm.com>
* | flatpak-dir: Cache the summary GBytes in FlatpakRemoteStatePhilip Withnall2020-08-242-0/+4
| | | | | | | | | | | | | | | | | | | | `FlatpakRemoteState` already caches the parsed `GVariant` form of the summary, but it will be useful (in the following commits) to also have a pointer to the `GBytes` which backs that variant. The `GBytes` will be passed into OSTree in the following commits, to allow it to avoid unnecessarily re-downloading the `summary` file. Signed-off-by: Philip Withnall <withnall@endlessm.com>
* | flatpak-transaction: Don’t update metadata when uninstallingPhilip Withnall2020-08-241-0/+7
| | | | | | | | | | | | | | | | | | | | | | When uninstalling a single app (an example of a transaction which is entirely local-only), there’s no need to update the repository metadata beforehand — but the code was doing that. This avoids an unnecessary download of the `summary.sig` file (or other repository metadata, depending on what’s out of date) when uninstalling. Signed-off-by: Philip Withnall <withnall@endlessm.com>
* | dir: Clarify a comment about cachingPhilip Withnall2020-08-241-1/+1
| | | | | | | | | | | | | | | | | | `flatpak-dir.c` supports two caches for `summary{,.sig}` files: one in memory (per `FlatpakDir` instance) and one on disk (shared between all users of the repository). Clarify in this comment which one is being referred to. Signed-off-by: Philip Withnall <withnall@endlessm.com>
* | dir: Tidy up definition of cache timeoutPhilip Withnall2020-08-241-1/+1
| | | | | | | | | | | | | | | | Adding brackets makes it a little more obvious that it’s 5 minutes, and less likely that operator precedence where the macro is used will result in the wrong value being calculated. Signed-off-by: Philip Withnall <withnall@endlessm.com>
* | dir: Fix caching of summary filesPhilip Withnall2020-08-241-0/+9
| | | | | | | | | | | | | | | | | | Cache hits didn’t result in the cache entry’s timeout being extended, and timeouts didn’t result in the entry being removed from the cache to free up resources (even though it would never be returned as a cache hit again). Signed-off-by: Philip Withnall <withnall@endlessm.com>
* | dir: Fix potential overflow when comparing cache timeoutsPhilip Withnall2020-08-241-1/+1
|/ | | | | | | Also use a constant to clarify the code a little, although it’s functionally equivalent. Signed-off-by: Philip Withnall <withnall@endlessm.com>
* Revert "CI: Run make check in parallel (-j NCPU)"Alexander Larsson2020-08-241-1/+2
| | | | This reverts commit 4401862ac55afc3fe496a2056f2c6c15b2d98678.
* CI: Run make check in parallel (-j NCPU)Alexander Larsson2020-08-211-2/+1
|
* Properly validate configured collection IDsPhaedrus Leeds2020-08-213-10/+46
| | | | | | | | | | | | | This commit is a follow-up for the commit "dir: Validate locally configured collection IDs". Whereas in that commit we validate the collection ID in flatpak_remote_state_fetch_commit_object(), here we do it in _flatpak_dir_get_remote_state(), since fetch_commit_object() is not called on the code path normally taken for a transaction (only if try_resolve_op_from_metadata() fails and in other niche scenarios). This should ensure that if someone erroneously sets a collection ID on a remote, the error will be caught quickly. It also helps the eos-updater unit tests pass.
* oci-auth: Don't ask for authentication if anon auth fails with weird errorAlexander Larsson2020-08-201-2/+15
| | | | | | | If the initial anonymous fails for any other reason than "not authorized" we immediately fail the operation instead of asking for user/password. The later is creating a very bad UX in case of e.g. networking or infrastructure issues, as described in #3753.
* Allow multiarch in the apply_extra for extra-dataAlexander Larsson2020-08-201-0/+2
| | | | | | | | | | | Some things could need to run e.g. i386 code in apply_extra (for example #3742). In this very limited context (almost everything is read-only) this seems pretty secure. We could require the app to specify a multiarch pemission to allow this, but such permissions only really make sense for an app, and extra data is often used for other things like runtimes and extensions, that seems a bit weird. Lets just enable it always.
* run: Fix double free in the cups config file parserAlexander Larsson2020-08-181-9/+9
| | | | | We were returning a g_autofree:d string and it was then also freed by the parent.