summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* README: Update chat room linkreadme-update-chat-linkPhaedrus Leeds2021-05-271-1/+1
| | | | | | We've moved from Freenode to Matrix, see: https://discourse.flathub.org/t/should-flathub-flatpak-move-to-another-communication-channel-if-so-where-and-why/1443 https://lists.freedesktop.org/archives/flatpak/2021-May/002127.html
* portal: Add some test coverageSimon McVittie2021-05-255-2/+743
| | | | | | This exercises Spawn() and reproduces #4286. Signed-off-by: Simon McVittie <smcv@collabora.com>
* portal: Add some design-for-testSimon McVittie2021-05-251-4/+26
| | | | | | | | | | | During unit testing we don't have a complete Flatpak app or runtime available, and `flatpak run` is not necessarily in FLATPAK_BINDIR yet; but we can run the portal with this environment variable set, to specify a mock implementation of Flatpak. This helps to reproduce #4286. Signed-off-by: Simon McVittie <smcv@collabora.com>
* portal: Add NONE values for flags setsSimon McVittie2021-05-251-0/+3
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* tests: Test environment block parsingSimon McVittie2021-05-252-0/+133
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* context: Factor out functions to parse an environment blockSimon McVittie2021-05-252-24/+55
| | | | | | This makes them easier to test, and easier to use in related tests. Signed-off-by: Simon McVittie <smcv@collabora.com>
* portal: Remap --env-fd into child process's fd spaceSimon McVittie2021-05-251-2/+10
| | | | | | | | | | Just because we can allocate a new, unused fd in the portal's fd space, that doesn't mean that fd number is going to be unused in the child process's fd space: we might need to remap it. Resolves: flatpak/flatpak#4286 Fixes: aeb6a7ab "portal: Convert --env in extra-args into --env-fd" Signed-off-by: Simon McVittie <smcv@collabora.com>
* portal: Use a GArray to store fdsSimon McVittie2021-05-251-39/+42
| | | | | | | | | | | | This will allow us to add additional mapping entries for fds to be used internally by `flatpak run`, in particular --env-fd. Defer the second pass through the fd array until the last possible moment, so that any extra fds we want to add (like the --env-fd) have already been added by then. Helps: flatpak/flatpak#4286 Signed-off-by: Simon McVittie <smcv@collabora.com>
* portal: Don't leak fd used for serialized environmentSimon McVittie2021-05-251-3/+4
| | | | | | | | | Otherwise we'll run out of file descriptors eventually, when starting a sufficiently large number of subsandboxes. Resolves: flatpak/flatpak#4285 Fixes: aeb6a7ab "portal: Convert --env in extra-args into --env-fd" Signed-off-by: Simon McVittie <smcv@collabora.com>
* Don't disable -Wformat-nonliteral unnecessarilySimon McVittie2021-05-251-12/+0
| | | | | | | These functions were already annotated with G_GNUC_PRINTF, so gcc can assume that the format string and arguments match up. Signed-off-by: Simon McVittie <smcv@collabora.com>
* Add missing G_GNUC_PRINTF attributesSimon McVittie2021-05-255-13/+3
| | | | | | | | | | This allows callers to be checked for mismatches between format string and arguments, and also means gcc can assume that the format string and the arguments match up correctly when forwarding them to functions like g_strdup_vprintf, removing the need to suppress -Wformat-nonliteral warnings. Signed-off-by: Simon McVittie <smcv@collabora.com>
* completion: Always pass a format string to flatpak_completion_debugSimon McVittie2021-05-251-1/+1
| | | | | | | | In principle this could have been subject to a format string attack via an argument containing %n, although in practice the code that uses this format string is #if 0. Signed-off-by: Simon McVittie <smcv@collabora.com>
* testcommon: Use unusual architectures where it doesn't matterSimon McVittie2021-05-251-77/+77
| | | | | | | | | | | | | | If we use x86_64 and i386 in places where any architecture would do, it's harder to recognise whether the test is assuming every machine is x86 and would fail elsewhere (e.g. as fixed in #4142). When just parsing abstract strings where any syntactically valid architecture would do, let's use rare/niche architectures that none of the maintainers are running on, so that hard-coding x86_64 or i386 stands out more. I've used mips64 and m68k because they happen to be the same length as x86_64 and i386, avoiding re-indentation. Signed-off-by: Simon McVittie <smcv@collabora.com>
* Update Danish translationscootergrisen2021-05-251-219/+171
|
* Merge pull request #4256 from flatpak/remote-ls-all-archesPhaedrus Leeds2021-05-1912-92/+249
|\ | | | | Add FLATPAK_QUERY_FLAGS_ALL_ARCHES for list_remote_refs()
| * CLI: List arch if it is not the primary arch (even if unique)Alexander Larsson2021-05-193-3/+31
| | | | | | | | | | | | Currenly we only list arch in the list of things to install from a transaction if not all the refs are the same arch. It makes more sense to show the arch even if its unique if they are not the primary arch.
| * Include more architectures when listing installed refs.Alexander Larsson2021-05-192-57/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It turns out that we can't currently uninstall a ref from a non-standard arch without specifying the arch even if there is no similar ref installed for the main arch. (#4264) The fundamental reason for this that `flatpak_dir_find_installed_ref(s)` currently only returns refs with standard arches unless you explicitly specify an arch. This changes flatpak_dir_find_installed_refs() to always return all the refs for all installed arches. This is generally what we want anyway, except in the case of "flatpak run org.some.Platform" where we don't want to prompt if there are multiple arches installed, so that is manually changed. This changes find_matching_ref() to look for refs in all arches, but always prefer (without prompting) the default arch if that is installed. This also matches what all current callers want. Fixes #4264
| * builtin-utils: Use shared helperAlexander Larsson2021-05-191-5/+11
| | | | | | | | | | This uses the new flatpak_remote_state_ensure_subsummary_all_arches() helper in ensure_remote_state_all_arches().
| * Transaction: Ensure we download the subsummary for the arch of added refsAlexander Larsson2021-05-193-21/+27
| | | | | | | | | | | | | | | | By default we only download the main arch subsummary, so if you added a ref for some other arch it failed to find the ref. This works with the CLI, because it explicilty loads the subsummary when its trying to expand the parial ref to the full ref. However apps using libflatpak don't do that so they failed.
| * Add FLATPAK_QUERY_FLAGS_ALL_ARCHES for list_remote_refs()Alexander Larsson2021-05-194-6/+55
|/ | | | | | | This allows flatpak_installation_list_remote_refs_sync_full() to list refs for all arches on remotes that use the new subsummary format. Fixes #4252
* doc: Add a release checklist for maintainersSimon McVittie2021-05-171-0/+19
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* tests: Fix test-summaries.sh when running tests as rootPhilip Withnall2021-05-171-1/+8
| | | | | | | | | If the tests are run as root, the system helper is not used even when commands are run with `--system`. This means a different cache path is used (see `_flatpak_dir_ensure_repo()`). The tests did not accommodate for that. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* Merge pull request #4269 from pwithnall/strcmp-crashPhilip Withnall2021-05-111-1/+1
|\ | | | | dir: Avoid a crash when looking up summary for a ref without an arch
| * dir: Avoid a crash when looking up summary for a ref without an archPhilip Withnall2021-05-111-1/+1
|/ | | | | | | | | If looking up the summary for a ref without an arch (for example, `ostree-metadata`, which the Endless OS version of flatpak uses in some backwards-compatibility code), avoid passing `NULL` to `strcmp()` and hence crashing. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* Fix several memory leaksPhaedrus Leeds2021-05-044-7/+9
|
* utils: Add missing check for empty string collection idPhaedrus Leeds2021-05-041-0/+2
|
* list: Add a g_assert() for a coverity warningPhaedrus Leeds2021-05-041-0/+1
|
* dir: Fix a GString leakPhaedrus Leeds2021-05-041-17/+10
|
* remote-info: Fix memory leak of branchPhaedrus Leeds2021-05-041-1/+1
|
* remote-info: Fix printing of branchPhaedrus Leeds2021-05-041-1/+1
|
* common: Fix several memory leaksPhaedrus Leeds2021-05-043-9/+11
|
* context: Fix leak of env var key/value pairPhaedrus Leeds2021-05-041-3/+5
|
* Fix memory errors w/ use of var_arrayofstring_to_strv()Phaedrus Leeds2021-05-043-7/+15
|
* utils: Fix use-after-free and logic errorPhaedrus Leeds2021-05-041-1/+1
| | | | | | | | Without this change, validate_component() might free the "component" variable, but then go on to keep using it. This change also makes the code work as intended, to only have a flatpak-specific "bundle" in the appstream xml (where here bundle does not mean "flatpak single-file bundle").
* remote-list: Check for unlikely libostree errorPhaedrus Leeds2021-05-041-2/+4
|
* Update translation files for v1.11.1 release1.11.1Simon McVittie2021-04-2619-7918/+9118
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* Release v1.11.1Simon McVittie2021-04-261-1/+1
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* NEWS: Summarize changes since 1.10.2Simon McVittie2021-04-261-0/+42
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* Merge tag '1.10.2', omitting changes in po/Simon McVittie2021-04-262-0/+19
|\ | | | | | | | | | | Release 1.10.2 Git-EVTag-v0-SHA512: 849c1f828b993144d61353fc8f233d5f62ef773d4ded35e406797260b55a371cd7dc77cba1a4de912e05e9530f40adf9963789ac896ed3fe19ebce352031b85b
| * Update pofiles for release1.10.2Alexander Larsson2021-03-1019-1710/+1805
| |
| * Update NEWS and version for releaseAlexander Larsson2021-03-102-1/+18
| |
| * dir: Refuse to export .desktop files with suspicious uses of @@ tokensSimon McVittie2021-03-101-1/+5
| | | | | | | | | | | | | | | | | | | | | | This is either a malicious/compromised app trying to do an attack, or a mistake that will break handling of %f, %u and so on. Either way, if we refuse to export the .desktop file, resulting in installation failing, then it makes the rejection more obvious than quietly removing the magic tokens. Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit 46b3ede5241561c7d588951048c687c5075a3eac)
| * dir: Reserve the whole @@ prefixSimon McVittie2021-03-101-1/+1
| | | | | | | | | | | | | | | | | | If we add new features analogous to file forwarding later, we might find that we need a different magic token. Let's reserve the whole @@* namespace so we can call it @@something-else. Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit 1e7e8fdb24b51078f4c48e0711e24a14930ba1f0)
| * Disallow @@ and @@u usage in desktop filesRyan Gonzalez2021-03-101-0/+2
| | | | | | | | | | | | Fixes #4146. (cherry picked from commit 652a28ffab67cb6cd7d12dc3a93979bcd3731c7f)
| * Update dates in NEWS fileGregor Simm2021-03-101-2/+2
| | | | | | | | | | | | In the NEWS file, it says that versions 1.10.1 and 1.10.1 were released in 2020. Shouldn't that read 2021? (cherry picked from commit bcd74255975638560081e81b36ec1354dd29d4f6)
| * common: Fix Spawn portal method not working with UTF-8 filesBastien Nocera2021-03-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the portal's Spawn method is used with the environment cleared, it's very likely that the "flatpak run" that ends up being run will be in an environment without UTF-8 support. If one of the files or directories we try to expose to the sub-sandbox contains UTF-8/non-ASCII characters, then "flatpak run" would fail with: error: Invalid byte sequence in conversion input This is caused by GOption trying to parse the --filesystem option for flatpak, as, when using the G_OPTION_ARG_CALLBACK argument type, GOption will split the option name from its value, and try to convert the value to UTF-8. Which will fail because there's no UTF-8. It won't however do that if we tell the option parser that the value is a filename using G_OPTION_FLAG_FILENAME, so set it. (cherry picked from commit e67847e253da6756886cc727687f00c57a03b816)
| * run: Propagate X11 cookies with an address equals to XAUTHLOCALHOSTNAMELudovico de Nittis2021-03-101-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OpenSUSE inherits the hostname value from DHCP without updating its X11 authentication cookie, and it keeps the initial value in `XAUTHLOCALHOSTNAME`. To avoid breaking the X11 applications, OpenSUSE patches libxcb so that it also considers the value in `XAUTHLOCALHOSTNAME` as another possible hostname. https://bugzilla.opensuse.org/show_bug.cgi?id=262309 To cope with that behavior we need to check `XAUTHLOCALHOSTNAME` too and, if we have a cookie with that address, propagate it inside the container adjusting its address to the canonical hostname `unames.nodename`. Fixes: #4043 Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com> (cherry picked from commit fd6a3b79f4e022e3f41f0c71ab7c6f21393c0db1)
| * CI: Add 1.10 branchPhaedrus Leeds2021-02-191-0/+2
| |
| * Add G_BEGIN_DECLS/G_END_DECLS to public headersKalev Lember2021-02-199-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | This ensures that we correctly specify C linkage when including flatpak headers from C++ code. This should fix fallout from glib's change to include C++ code in its headers, see https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1935 for discussion. Fixes https://github.com/flatpak/flatpak/issues/4117 (cherry picked from commit 426284759c58df81bdbc80167f01058a2c197c0d)
| * testlibrary: Fix memory leaksPhaedrus Leeds2021-02-191-2/+2
| | | | | | | | (cherry picked from commit 7224809bc1e2584708b29ec1389cbcf1eeba1d3f)