summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* common: Fix an uninitialized variableHEADmainSimon McVittie2023-05-171-1/+1
| | | | | | | | | This could be uninitialized if the app has --socket=fallback-x11 but not --socket=wayland, although that's a combination that doesn't make a great deal of sense. Regression introduced during recent refactoring. Fixes: db7a8bb5 "common: Split up socket setup from flatpak-run into multiple files" Signed-off-by: Simon McVittie <smcv@collabora.com>
* common: Move json-glib backports to their own fileSimon McVittie2023-05-174-12/+37
| | | | | | There is currently no source for this one, only a header. Signed-off-by: Simon McVittie <smcv@collabora.com>
* glib-backports: Use g_ascii_string_to_unsigned if GLib is new enoughSimon McVittie2023-05-174-65/+72
| | | | | | | | | | | | Use the real GLib function if we can, and resync the backport with the version in GLib 2.76.2: use a compatibility replacement for G_NUMBER_PARSER_ERROR so that it can be textually identical to the version in GLib, and revert Flatpak changes to the whitespace. The only functional change is that if the function fails, we'll raise G_NUMBER_PARSER_ERROR_INVALID if GLib is new enough. Signed-off-by: Simon McVittie <smcv@collabora.com>
* glib-backports: Move flatpak_utils_ascii_string_to_unsigned to hereSimon McVittie2023-05-174-92/+91
| | | | | | | | Currently this is used unconditionally, even if GLib is new enough. That will be changed in a subsequent commit; no functional change intended in this one. Signed-off-by: Simon McVittie <smcv@collabora.com>
* glib-backports: Resync g_get_language_names_with_category with GLib 2.76.2Simon McVittie2023-05-171-2/+4
| | | | | | | | - 0e7bf99e "Use "e" mode flag in fopen () calls for race-free setting of the close-on-exec flag" - Add #ifndef G_OS_WIN32, which is irrelevant for Flatpak but keeps the code textually equivalent to GLib's Signed-off-by: Simon McVittie <smcv@collabora.com>
* glib-backports: Resync ISO8601 parsing with GLib 2.76.2Simon McVittie2023-05-171-19/+39
| | | | | | | | | | | | - 3384ed3f "Fixing signedness warnings in glib/gdatetime.c" - faa1d63c "glib: Fix various compiler warnings when compiling with G_DISABLE_ASSERT" - 4ddabfc6 "gdatetime: Avoid an assertion failure when parsing some ISO 8601 dates" - b4eaac58 "gdatetime: Handle leap seconds in ISO8601 dates" - f9d0135a "gdatetime: Port to use new g_time_zone_new_identifier() constructor" (partially reverted here) - c3805d74 "gdatetime: Disallow NAN as a number of seconds in a GDateTime" - 5d7f4b8f "gdatetime: Remove floating point from seconds parsing code" - d5580edf "Fix non-initialized variable in glib/gdatetime.c"
* glib-backports: Document which version we backportedSimon McVittie2023-05-171-1/+1
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* glib-backports: Add a note that a couple of functions aren't backportsSimon McVittie2023-05-172-0/+5
| | | | | | | | | We can't backport GLib's implementations of these, because they make use of GHashTable/GPtrArray internals. Instead, we have a reimplementation of the same API, which accepts the cost of some redundant work as a reasonable price to pay for backwards-compatibility. Signed-off-by: Simon McVittie <smcv@collabora.com>
* glib-backports: Make g_key_file_save_to_file match the GLib implementationSimon McVittie2023-05-171-0/+6
| | | | | | | This just adds some assertions, no functional changes (assuming we're calling it correctly). Signed-off-by: Simon McVittie <smcv@collabora.com>
* common: Move direct backports from GLib to a new translation unitSimon McVittie2023-05-176-857/+916
| | | | | | | | | | | | | | | | | flatpak-utils.c is getting quite large, and is a mixture of code with and without non-GLib dependencies, making it inconvenient to reuse in other projects (like Steam's pressure-vessel) or link into Flatpak services that don't need all of our dependencies (json-glib, appstream, ostree). One obvious piece of low-hanging fruit for reducing the size of this file is to move the GLib backports into their own translation unit. Sort them by GLib version, so that when we increase our GLib dependency it's easy to delete the ones that are no longer applicable. No functional changes intended in this commit. Signed-off-by: Simon McVittie <smcv@collabora.com>
* common: Split up socket setup from flatpak-run into multiple filesSimon McVittie2023-05-1515-1372/+1744
| | | | | | | | | | flatpak-run is large enough to be getting unwieldy, so separate it out into various smaller modules. A side benefit of these is that they'll be easier to reuse in other projects, like Steam's pressure-vessel tool. Signed-off-by: Simon McVittie <smcv@collabora.com>
* check.yml: bump Ubuntu runner for valgrindK.B.Dharun Krishna2023-04-081-1/+1
|
* check.yml: bump actions/upload-artifacts to v3K.B.Dharun Krishna2023-04-081-3/+3
|
* check.yml: remove glib260 ppaK.B.Dharun Krishna2023-04-081-1/+0
| | | The required package is present in Ubuntu repos https://packages.ubuntu.com/focal/libglib2.0-dev
* block-autosquash-commits.yml: bump block-autosquash-commits-action version ↵K.B.Dharun Krishna2023-04-081-1/+1
| | | | to 2.2.0
* check.yml: bump actions/checkout version and replace deprecated 18.04 runner ↵K.B.Dharun Krishna2023-04-081-6/+6
| | | | with 20.04
* ci: trigger differential-shellcheck workflow on pushJan Macku2023-03-311-2/+3
| | | Fixes: redhat-plumbers-in-action/differential-shellcheck#215
* tests: Add a test for atomicity of eol-rebase updatesDan Nicholson2023-03-301-1/+23
| | | | | | This adds a test to cover the changes in the previous commit. Helps: #3991
* app: Port transaction subclasses to use add_rebase_and_uninstall()Philip Withnall2023-03-302-31/+2
| | | | | | | | | | This fixes the possible situation where an eol-rebase app can be uninstalled and the new version not correctly installed (due to, for example, the install op failing due to a lack of disk space). Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Fixes: #3991
* transaction: Add new flatpak_transaction_add_rebase_and_uninstall() APIPhilip Withnall2023-03-304-7/+127
| | | | | | | | | | | | | | | | This mostly replaces `flatpak_transaction_add_rebase()`. It’s necessary because the uninstall op for an eol-rebased app needs to be linked to the install/update op for the rebased app, otherwise one op can proceed after the other has failed (or they can be run in the wrong order) and result in the old app being uninstalled but the new one not installed. The following commit will port the internal flatpak `FlatpakTransaction` subclasses to use it. Other consumers of `FlatpakTransaction` (such as gnome-software) will have to be ported as well. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Fixes: #3991
* transaction: Add an out_op argument to flatpak_transaction_add_ref()Philip Withnall2023-03-301-6/+14
| | | | | | | | | This will be used in the next commit to simplify some new code. Currently, this introduces no functional changes. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #3991
* testlibrary: Initialize autofree variable to silence a compiler warningSimon McVittie2023-03-301-1/+1
| | | | | | | | | As with commit 43085c0e "dir: Consistently initialize g_autofree variables", this is currently harmless because we never actually early-return or goto out of the region between declaration and initialization, but some compiler versions log a warning here anyway. Signed-off-by: Simon McVittie <smcv@collabora.com>
* Use new --disable-userns bubblewrap feature when possibleAlexander Larsson2023-03-241-0/+32
| | | | | | | | | | | | | | This feature (added in https://github.com/containers/bubblewrap/pull/488) allows us to improve the guarantees of disallowing the sandbox to use recursive user namespaces (which is a security risk) compared to the existing limits that use seccomp. [smcv: Move this to flatpak_run_setup_base_argv() so it will apply equally in apply_extra_data() and `flatpak build`; make the compile-time check for a setuid bwrap into a runtime check] Co-authored-by: Simon McVittie <smcv@collabora.com> Signed-off-by: Simon McVittie <smcv@collabora.com>
* build: Require bubblewrap 0.8.0Simon McVittie2023-03-243-3/+2
| | | | | | This lets us use its new features unconditionally. Signed-off-by: Simon McVittie <smcv@collabora.com>
* run: Make it clearer that rest_argv_start is not used uninitializedSimon McVittie2023-03-201-2/+3
| | | | | | | | rest_argv_start is initialized whenever rest_argc != 0, so the previous code was in fact safe; but this wasn't obvious to either a human reader or the compiler, and some gcc versions warn here. Signed-off-by: Simon McVittie <smcv@collabora.com>
* dir: Consistently initialize g_autofree variablesSimon McVittie2023-03-201-1/+1
| | | | | | | | | | | | | | | All g_autofree and g_autoptr variables should be initialized, either with a value or NULL, and some gcc versions warn if they are not. This particular instance was harmless, because we initialized regexp to either NULL or a valid non-NULL value as the first statement of the function, so there was no way to return before regexp was initialized; but if we introduced an early-return such as a g_return_val_if_fail before the current first statement, then that early return would have caused uninitialized stack contents to be freed, likely resulting in a crash. Signed-off-by: Simon McVittie <smcv@collabora.com>
* Update submodule: bubblewrap 0.8.0Simon McVittie2023-03-201-0/+0
| | | | | | | | * Improve error message if seccomp is disabled in kernel config * Add --disable-userns option (needed for #5084) * Add --assert-userns-disabled option (needed for #5084) Signed-off-by: Simon McVittie <smcv@collabora.com>
* dir: Fix a minor leak of an OSTree checksumPhilip Withnall2023-03-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The checksum here can leak if `flatpak_dir_remote_load_cached_summary()` returns false at least once. Spotted by asan while running gnome-software: ``` Direct leak of 2925 byte(s) in 45 object(s) allocated from: #0 0x7f44774ba6af in __interceptor_malloc (/lib64/libasan.so.8+0xba6af) #1 0x7f44764c941a in g_malloc ../../source/glib/glib/gmem.c:130 #2 0x7f445bc860e7 in ostree_checksum_from_bytes src/libostree/ostree-core.c:1599 #3 0x7f445bdbea82 in flatpak_dir_remote_fetch_indexed_summary /opt/gnome/source/flatpak/common/flatpak-dir.c:12563 #4 0x7f445bd9932e in flatpak_remote_state_ensure_subsummary /opt/gnome/source/flatpak/common/flatpak-dir.c:577 #5 0x7f445bdbfd42 in _flatpak_dir_get_remote_state /opt/gnome/source/flatpak/common/flatpak-dir.c:12872 #6 0x7f445bdc006c in flatpak_dir_get_remote_state_optional /opt/gnome/source/flatpak/common/flatpak-dir.c:12953 #7 0x7f445be07886 in flatpak_transaction_ensure_remote_state /opt/gnome/source/flatpak/common/flatpak-transaction.c:2057 #8 0x7f445be095c7 in flatpak_transaction_add_ref /opt/gnome/source/flatpak/common/flatpak-transaction.c:2732 #9 0x7f445be09c37 in flatpak_transaction_add_update /opt/gnome/source/flatpak/common/flatpak-transaction.c:2940 #10 0x7f445bdd202c in flatpak_installation_list_installed_refs_for_update /opt/gnome/source/flatpak/common/flatpak-installation.c:1103 #11 0x7f445bf07824 in gs_flatpak_add_updates ../../source/gnome-software/plugins/flatpak/gs-flatpak.c:2082 #12 0x7f445bf2e2b9 in gs_plugin_add_updates ../../source/gnome-software/plugins/flatpak/gs-plugin-flatpak.c:484 #13 0x7f44770533b2 in gs_plugin_loader_call_vfunc ../../source/gnome-software/lib/gs-plugin-loader.c:620 #14 0x7f447705430f in gs_plugin_loader_run_results ../../source/gnome-software/lib/gs-plugin-loader.c:748 #15 0x7f447706cb03 in gs_plugin_loader_process_thread_cb ../../source/gnome-software/lib/gs-plugin-loader.c:3110 #16 0x7f44769967ed in g_task_thread_pool_thread ../../source/glib/gio/gtask.c:1531 #17 0x7f447650e760 in g_thread_pool_thread_proxy ../../source/glib/glib/gthreadpool.c:350 #18 0x7f447650dd02 in g_thread_proxy ../../source/glib/glib/gthread.c:831 ``` Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* tests: Call g_test_init() before isolated_test_dir_global_setup()Simon McVittie2023-03-172-4/+2
| | | | | | | | | | | | | g_test_init() is meant to be called before any other use of GTest APIs, and isolated_test_dir_global_setup() can call g_test_message(). GLib 2.76 makes this more of a practical problem. (isolated_test_dir_global_setup() is essentially a reimplementation of G_TEST_OPTION_ISOLATE_DIRS, since we don't depend on GLib 2.60.) Alternative to https://github.com/flatpak/flatpak/pull/5355. Signed-off-by: Simon McVittie <smcv@collabora.com>
* security policy: Downgrade 1.12.x, 1.10.x to "supported if feasible"Simon McVittie2023-03-171-2/+8
| | | | | | | | We have too many branches and too few maintainers to be able to treat old-stable branches as fully supported. Helps: #5352 Signed-off-by: Simon McVittie <smcv@collabora.com>
* Set size of file info for symlinks to 0Jan Alexander Steffens (heftig)2023-03-171-0/+1
| | | | | `ostree_raw_file_to_content_stream` will try to read it, causing a critical warning with GLib 2.76 causing tests to fail.
* Update translation files for release1.15.4Simon McVittie2023-03-1623-2953/+2999
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* Prepare v1.15.4Simon McVittie2023-03-163-4/+4
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* Update NEWSSimon McVittie2023-03-161-0/+21
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* run: Prevent TIOCLINUX ioctl, the same as TIOCSTISimon McVittie2023-03-163-1/+20
| | | | | | | | | | | | | | | | The TIOCLINUX ioctl is only available on Linux virtual consoles such as /dev/tty1. It has several Linux-specific functions, one of which is a copy/paste operation which can be used for attacks similar to TIOCSTI. This vulnerability does not affect typical graphical terminal emulators such as xterm, gnome-terminal and Konsole, and Flatpak is primarily designed to be run from a Wayland or X11 graphical environment, so this is relatively unlikely to be a practical problem. CVE-2023-28100, GHSA-7qpw-3vjv-xrqp Resolves: https://github.com/flatpak/flatpak/security/advisories/GHSA-7qpw-3vjv-xrqp Signed-off-by: Simon McVittie <smcv@debian.org>
* cli-transaction: Escape any special characters in the EOL reasonSimon McVittie2023-03-161-1/+4
| | | | | | CVE-2023-28101, GHSA-h43h-fwqx-mpp8 Signed-off-by: Simon McVittie <smcv@collabora.com>
* Reject paths given to --filesystem/--persist with special charactersRyan Gonzalez2023-03-165-14/+189
| | | | | | | | | | There isn't much in the way of legit reasons for this, but it's a potential security footgun when displaying the text. CVE-2023-28101, GHSA-h43h-fwqx-mpp8 Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com> Co-authored-by: Simon McVittie <smcv@collabora.com>
* Ensure special characters in permissions and metadata are escapedRyan Gonzalez2023-03-168-11/+168
| | | | | | | | | This prevents someone from placing special characters in order to manipulate the appearance of the permissions list. CVE-2023-28101, GHSA-h43h-fwqx-mpp8 Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
* Update Turkish TranslationSabri Ünal2023-03-161-146/+111
| | | | - Translate new strings. - To ensure consistency with Git terminology, use "İşleme" as a translation for "Commit".
* Update Swedish translationAnders Jonsson2023-03-161-97/+51
|
* Occitan translations updatedMejans2023-03-161-130/+125
|
* Document path used for flatpak-overrideFabio Pagnotta2023-03-061-0/+3
|
* Update Polish translationPiotr Drąg2023-03-061-24/+24
|
* transaction: Remove unused error argument from flatpak_transaction_add_op()Philip Withnall2023-02-231-22/+8
| | | | | | Introduces no functional changes, but simplifies the code a little. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* transaction: Fix a minor typo in a documentation commentPhilip Withnall2023-02-211-1/+1
| | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* Russian translation updateDmitry2023-02-211-13/+13
|
* Prepare v1.15.31.15.3Simon McVittie2023-02-213-4/+12
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* Update i18n files for releaseSimon McVittie2023-02-2123-3780/+5197
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* meson: Use flatpak in all-lower-case as the machine-readable project nameSimon McVittie2023-02-211-2/+2
| | | | | | | The Meson project name is more like Autotools PACKAGE_TARNAME, and in particular is used in the name of the dist tarball. Signed-off-by: Simon McVittie <smcv@collabora.com>
* README: Signpost https://flatpak.org/setup/ as a good way to installSimon McVittie2023-02-211-0/+4
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>