Commit Graph

7069 Commits

Author SHA1 Message Date
Ettore Atalan
a86489ae4e Update German translation 2022-08-16 10:45:36 +02:00
Simon McVittie
a03111a3d1 enter: Don't overwrite the DISPLAY
Now that we're using the same display number in the sandbox as on the
host, we can forget about overwriting it with :99.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-08-16 10:45:08 +02:00
Simon McVittie
ca992c7862 run: Preserve X11 display number instead of redirecting it to :99
Suppose the user's "real" X11 display on the host is Xorg or Xwayland
listening on :42, but they also have an Xvfb server listening on :99.

If we change the X11 display number to the arbitrary value :99, and
the Flatpak sandbox shares its network namespace with the host, then
clients inside the Flatpak sandbox will prefer to connect to the
abstract socket @/tmp/.X11-unix/X99 (which is Xvfb), rather than the
filesystem-backed socket /tmp/.X11-unix/X99 in the sandbox (which is
really /tmp/.X11-unix/X42 on the host, i.e. Xorg or Xwayland).

If they're relying on Xauthority (MIT-MAGIC-COOKIE-1) for access
control (as many display managers do), then this will fail, because
we gave the sandboxed app access to the cookies for Xorg/Xwayland
(rewriting their display number from 42 to 99 as we did so), but
Xvfb does not accept those cookies.

If we're relying on `xhost +"si:localuser:$(id -nu)"` for access control
(as gdm does), then the Flatpak app will successfully (!) connect to
whatever is on :99, for example Xvfb or Xephyr, which is rarely what
anyone wants either.

Resolves: https://github.com/flatpak/flatpak/issues/3357
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-08-16 10:45:08 +02:00
Phaedrus Leeds
60005cfcc2 build-export: Don't warn on missing Exec= if DBusActivatable=true
The Desktop Entry spec says that Exec= is only required if
DBusActivatable= is not set to true, so don't emit a warning when Exec=
is missing but not required.
2022-08-16 10:42:06 +02:00
Danilo Bargen
298286be2d build-export: Explicitly allow empty Exec values in desktop file 2022-08-16 10:42:06 +02:00
Danilo Bargen
6dbc097ac5 build-export: Avoid segfault if Exec line is missing from desktop file 2022-08-16 10:42:06 +02:00
Phaedrus Leeds
53a0b528bf Add DeploySideloadCollectionID flatpakref/flatpakrepo key
When Flatpak's P2P updates support was replaced with the "sideloading"
implementation in 1.7.1, a new server side repo config key
"deploy-sideload-collection-id" was added which gets set when you pass
"--deploy-sideload-collection-id" to "flatpak build-update-repo", and
has the effect of setting "xa.deploy-collection-id" in the repo metadata
that is pulled by clients, which itself causes a collection id to be set
on the remote for clients using Flatpak >= 1.7.1.

This commit adds an analogous key in flatpakref and flatpakrepo files,
so the collection id can be set when the remote is configured, rather
than later on when the repo metadata is pulled and acted upon. As before
with DeployCollectionID, it has no difference in function compared to
DeployCollectionID or CollectionID and the only difference is which
Flatpak versions are affected.

It would've been better if this were added in 1.7.1 when the sideload
support was added, but alas here we are.

(Also update the docs and unit tests)
2022-08-16 10:37:36 +02:00
Phaedrus Leeds
bf37034663 common: Add missing error codes to GDBusErrorEntry array
These were mistakenly only added to flatpak-error.h
2022-07-25 16:58:32 -04:00
Phaedrus Leeds
6db7806762 build-export: Fully ignore stdout content of icon validation
The docs for g_spawn_sync() say:
"Note that you must set the G_SPAWN_STDOUT_TO_DEV_NULL and
G_SPAWN_STDERR_TO_DEV_NULL flags when passing NULL for standard_output
and standard_error."

So add in the stdout flag when calling flatpak-validate-icon in the
build-export command. Without this, there's output in the test logs
from when they're building the test app, due to
https://github.com/flatpak/flatpak/pull/4803
2022-07-25 16:58:16 -04:00
Phaedrus Leeds
04d2d1cd3d CONTRIBUTING.md: Add instructions for using TESTS variable 2022-07-25 14:23:41 +01:00
Phaedrus Leeds
cf8979b1b0 app: Un-split translatable strings again
As with the previous commits, try not to split translatable sentences.
See the discussion here about whether the "Warning: "/"Error: " prefix
should be separable:
https://github.com/flatpak/flatpak/pull/4963#discussion_r908326539

Also, don't translate the "(internal error..." message since internal
errors shouldn't be translated to make debugging easier.
2022-07-23 14:18:50 -05:00
Phaedrus Leeds
0465c464af app: Remove a duplicated else if block 2022-07-23 14:18:50 -05:00
Phaedrus Leeds
da5a38c17c app: Un-split some translatable strings
Also make them a bit prettier while we're here

Fixes https://github.com/flatpak/flatpak/issues/4877
2022-07-23 14:18:50 -05:00
Phaedrus Leeds
bf2a0cc2ec app: Un-split EOL translatable sentences
Fixes https://github.com/flatpak/flatpak/issues/4956
2022-07-23 14:18:50 -05:00
Phaedrus Leeds
e1e6465f26 uninstall: Prompt for confirmation on used runtime removal
It doesn't make a lot of sense to prompt for confirmation when an in-use
extension is requested to be uninstalled, but not do so for an in-use
runtime, even if (or perhaps especially since) the latter causes the
transaction to fail later on.
2022-07-21 14:32:45 -05:00
Phaedrus Leeds
bf99c266a8 app: Tweak messages about dependent apps
Use a "Info: " prefix which matches the message printed in
print_eol_info_message(). Also make the message accurately use either
the word "runtime" or "extension" as appropriate.
2022-07-21 14:32:45 -05:00
Phaedrus Leeds
65a4bb0a3d uninstall: Ask for confirmation for used runtime extensions
Based on discussions on the issue tracker, it seems that users sometimes
remove runtime extensions without really understanding whether they're
in use. Add a confirmation prompt to address this.

Helps: #4549
2022-07-21 14:32:45 -05:00
Phaedrus Leeds
ae0de69b17 app: Improve checking for dependent apps in EOL messages
flatpak_dir_list_app_refs_with_runtime_extension() only works when the
runtime extension it is passed and the apps it returns are both
installed. Sometimes a end-of-life message is printed for a runtime that
is not installed but is being installed by the current transaction, or a
runtime that is installed but one of the apps that needs it is being
installed by the current transaction. To cover these cases, check the
operations in the current transaction when building informational
messages about EOL runtimes.
2022-07-21 14:32:45 -05:00
Phaedrus Leeds
e739773056 app: List apps that use a runtime extension when it's EOL
Currently if a runtime extension, e.g.
org.freedesktop.Platform.html5-codecs//18.08 is used by a runtime
org.kde.Platform//5.12 which itself is used by one or more apps, when we
print a message to the user about html5-codecs being EOL, we don't find
any apps using it and don't print any. Fix this by including apps that
indirectly use a runtime extension in the "Applications using this
runtime:" list.

In a later commit we can re-use the helper function added here to add a
confirmation dialog if the user tries to remove a runtime extension
that's being used; currently we just let them remove it.

This is limited to only looking in the current flatpak installation, so
a per-user app using a system-wide runtime extension would not be found.

This is implemented using in-memory caches because otherwise it is
horribly slow; see
https://github.com/flatpak/flatpak/pull/4835#discussion_r876425289

Helps: #3531
2022-07-21 14:32:45 -05:00
Phaedrus Leeds
07ef6a41fa transaction: Fix typos and wrap lines 2022-07-20 21:37:03 -05:00
Phaedrus Leeds
dffa10dd61 transaction: Tweak docs on get_related_to_ops() API 2022-07-20 21:37:03 -05:00
Alexmelman88
aee4596ffb Update ru.po (#4975) 2022-07-20 21:33:52 -05:00
dundunplus
5c5a30ed9c Updated Chinese translation (#4993) 2022-07-20 21:01:12 -05:00
Debarshi Ray
0329f657ee selinux: Permit read access to symbolic links in /var/lib/flatpak
Commit 8617ab0ad0 granted read and lock access to
/var/lib/flatpak but didn't cover symbolic links.  This explicitly
permits that to avoid running into SELinux denials.

https://bugzilla.redhat.com/show_bug.cgi?id=2071215
2022-07-20 20:43:54 -05:00
Phaedrus Leeds
f0c1097690 doc/flatpak-override: Tweak manpage 2022-07-18 19:23:57 -05:00
Phaedrus Leeds
43768b2510 common: Remove erroneous Since: annotations
I think these were accidentally copied from GLib.
2022-07-18 18:51:07 -05:00
Phaedrus Leeds
320889c1a2 app/flatpak-complete.c: Fix typo 2022-07-18 18:51:07 -05:00
Phaedrus Leeds
bf93e004e9 app: Fix inefficiency in pin and mask commands
There's no point reading data from disk on a code path that doesn't do
anything with it.
2022-07-18 18:51:07 -05:00
Fina Wilke
f4b038c8b1 Increase verbosity of extension missing error messages
Adds arch and branch to the error message to help with locating the required
extension arch and branch.
2022-07-17 15:36:21 -05:00
Debarshi Ray
120322cb8f CI: Use CodeQL Action v2, not the deprecated v1
See:
https://github.blog/changelog/2022-04-27-code-scanning-deprecation-of-codeql-action-v1/
2022-06-28 18:26:45 -07:00
Phaedrus Leeds
26a8124478 Revert "CI: Temporarily build without libsystemd"
This reverts commit ea879dc38c.

Folks say the issue is fixed on launchpad:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1979579
2022-06-28 18:23:40 -07:00
Phaedrus Leeds
b93d928679 .gitignore: Add tests/runtime-repo.stamp 2022-06-27 20:15:41 +01:00
Simon McVittie
0c5e4abbea try-syscall: Cope with old glibc without PR_SET_CHILD_SUBREAPER defined
Originally part of containers/bubblewrap#496 in bubblewrap.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-06-27 10:02:25 -07:00
Simon McVittie
836b0fb604 try-syscall: Use compiler-predefined macros to detect mips ABI
_MIPS_SIM_ABI32 etc. are defined by Linux <asm/sgidefs.h>, which is
included by glibc <sys/syscall.h> (which defers to Linux headers to
get syscall numbers), but not by musl <sys/syscall.h>.

_ABIO32 etc. are predefined by the compiler, so they are always
available, regardless of libc. References:

https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=27d54b2a6c18ef1ae50f1a5b432d590438445b90
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=0ea339ea4d9c3e04ae17da6bf389617eb0251e57

Originally containers/bubblewrap#492 in bubblewrap.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-06-27 10:02:25 -07:00
Phaedrus Leeds
ea879dc38c CI: Temporarily build without libsystemd
To fix the CI until this is resolved:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1979579
2022-06-24 15:11:41 -07:00
Phaedrus Leeds
6e5fb9dbc7 tests: Skip test-history.sh without libsystemd 2022-06-24 15:11:41 -07:00
Yuri Chornoivan
1b1fead748 Update Ukrainian translation 2022-06-24 10:15:50 -07:00
yakusha
02008eb1cb Update Turkish translation 2022-06-24 09:47:05 -07:00
Anders Jonsson
b243a290ff Update Swedish translation 2022-06-20 13:19:35 +02:00
Yuri Chornoivan
a91cd23f06 Update Ukrainian translation 2022-06-20 13:19:10 +02:00
Philip Withnall
ab028e0d71 flatpak-remote: Fix some minor leaks of some property values
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-06-20 13:17:45 +02:00
Piotr Drąg
6e157b95f3 Update POTFILES.in 2022-06-17 16:11:45 +02:00
Phaedrus Leeds
36b4d325fd Update pofiles for release 1.13.3 2022-06-16 15:57:42 -07:00
Phaedrus Leeds
1638be784d build: Bump version to 1.13.3 2022-06-16 15:57:42 -07:00
Phaedrus Leeds
22d52c6bc1 Update NEWS for 1.13.3 2022-06-16 15:57:42 -07:00
Debarshi Ray
c3e0b76ebe NEWS: Update for 1.13.3 so far 2022-06-16 09:52:23 -07:00
Alexander Larsson
4247e61fbe CI: Build appstream dependency
We need appstream >= 0.15.3 to get this fix:
  https://github.com/ximion/appstream/issues/384

Without it the test-suite fails.
2022-06-16 13:49:45 +02:00
Alexander Larsson
300c00c910 Extend the CI build support, including testing the soup backend
This adds a separate, more modern CI build running on ubuntu 22.04
using curl, and leaves the old one around building against soup.

In addition, the modern one uses the system bwrap and dbus-proxy so
that we test these configurations too (and because the modern system
has good versions of these).

I also enabled running parallel make check again, hoping that
whatever made this hang is now fixed. We'll see.
2022-06-16 13:49:45 +02:00
Alexander Larsson
9695923f14 CI: Add libcurl-dev to CI install 2022-06-16 13:49:45 +02:00
Alexander Larsson
aea92f3909 http: Support curl
If build with curl (--with-curl, which is default) then we use libcurl
instead of libsoup as the http backend.
2022-06-16 13:49:45 +02:00