Commit Graph

7164 Commits

Author SHA1 Message Date
Phaedrus Leeds
36b03000a8 search: Use <bundle> ID to determine flatpak app ID
The <bundle> element in the appstream data unambiguously provides the
full four-part flatpak ref, so use it to determine the app ID. But fall
back to using the <id> element, since that is required to be present.

(cherry picked from commit 39de0ef280)
2022-01-04 10:44:37 -08:00
Phaedrus Leeds
e916c8430e search: Don't strip .desktop suffix overzealously
This commit changes the search command to properly output the app ID for
IDs that end in .desktop, e.g. to print org.telegram.desktop rather than
org.telegram.

Fixes https://github.com/flatpak/flatpak/issues/4535

(cherry picked from commit 62e09b406b)
2022-01-04 10:44:37 -08:00
Will Thompson
919ada4856 run: Document shortcomings of PulseAudio server string parsing
These are just based on a cursory reading of the spec.

(cherry picked from commit eabbff6fef)
2022-01-04 10:44:37 -08:00
Will Thompson
456430a054 run: Add link to PulseAudio server string documentation
(cherry picked from commit bcc114383b)
2022-01-04 10:44:37 -08:00
Will Thompson
f95636cfe2 run: Support PulseAudio socket path without unix: prefix
https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/ServerStrings/
says:

> If the string starts with / or unix: the remaining address string is taken as
> UNIX socket name.

but previously the string was only taken to be a UNIX socket name if it began
with "unix:".

This is an issue in practice with WSLg <https://github.com/microsoft/wslg>
which sets $PULSE_SERVER to "/mnt/wslg/PulseServer", without a "unix:" prefix.

(cherry picked from commit 7534a970a5)
2022-01-04 10:44:37 -08:00
Philip Withnall
369d922d2c flatpak-utils-http: Ensure to wake up the main context on error
All the other code paths which set `data->done` or `data->error` ensure
to wake up the main context so its loop exit conditions can be checked
again — this code path was missing a wakeup though.

Spotted by code inspection; I haven’t hit this in the wild.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
(cherry picked from commit 8ff02c0e5b)
2022-01-04 10:44:37 -08:00
Simon McVittie
ff0f5a15b2 tests: Add basic test coverage for our seccomp filters
In particular, this checks that CVE-2017-5226, CVE-2019-10063 and
CVE-2021-41133 are still prevented.

Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 7c5aec474c)
2022-01-04 10:44:37 -08:00
Simon McVittie
f82e2a4577 tests: Add try-syscall helper
This exercises various syscalls. It's heavily based on the one from
<https://github.com/containers/bubblewrap/pull/459>, but with the
addition of a mode to output the numeric values of various expected
errno codes, which are not otherwise available to shell scripts.

Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 4ce251882c)
2022-01-04 10:44:37 -08:00
Phaedrus Leeds
4fe5316163 .gitignore: Update for recent changes
(cherry picked from commit 2181f4f171)
2022-01-04 10:44:37 -08:00
Phaedrus Leeds
ed6323f33c testlibrary: Don't use g_assert()
Per the documentation, g_assert_null() is meant for unit tests.

(cherry picked from commit 0258fc82bb)
2022-01-04 10:44:37 -08:00
Simon McVittie
00891111ab tests: Generate Makefile-test-matrix.am.inc in $(srcdir)
Files that are generated manually by a maintainer and committed to git
should be in the srcdir, not the builddir.

Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 647c51380c)
2022-01-04 10:44:37 -08:00
Jan Tojnar
74f625a186 tests: Allow FLATPAK_BINARY=flatpak for exports
a99b748931 introduced an environment variable for changing the flatpak path for exports.
On NixOS, we do not have a stable path we could use so we used to patch Flatpak to use `flatpak` program from `PATH`.
With the recent change, we drop our downstream patch in favour of setting the environment variable to `flatpak` but the tests do not expect that.

This is the test part of our former downstream patch so that tests can pass with exports using `flatpak` instead of an absolute path.
It still expects the binary path to end with `flatpak` so arbitrary `$FLATPAK_BINARY` will not work but we do not pass the environment variable to tests so we cannot do much better.

(cherry picked from commit 96dbe28cfa)
2022-01-04 10:44:37 -08:00
lumingzh
5ee45fa7f1 Add zh_CN.po 2022-01-04 09:47:27 -08:00
lumingzh
223b197c6d Update LINGUAS
Add zh_CN
2022-01-04 09:47:27 -08:00
Phaedrus Leeds
6cc48e5ef9 dir: Fix a typo in a comment 2022-01-04 09:33:28 -08:00
Phaedrus Leeds
d4d4bcf6d8 dir: Fix another deploy error code path
This is another case where commit 4beaa990c seems to have mistakenly
turned an error code path into one where the deploy appears successful
to the caller of flatpak_dir_deploy() but the commit doesn't actually
get deployed.
2022-01-04 09:33:28 -08:00
Phaedrus Leeds
58f495b6e5 dir: Fix an error path when deploying malformed apps
If an app was created without a files/ directory, which shouldn't happen
with flatpak-builder but could happen if the commit is crafted manually,
currently the install operation exits successfully but the app is not
actually installed. Instead, error out, as we were doing before commit
4beaa990c2.
2022-01-04 09:33:28 -08:00
Phaedrus Leeds
4619bedfdb app: Refuse to work with sudo and --user
Have heard of people running Flatpak commands with both sudo and --user,
and not expecting it work on the root user's installation. Let's just
not allow it since it's not something people ever do intentionally.
2022-01-04 11:49:07 +00:00
Phaedrus Leeds
b6f627aa6e tests: Make grep assertions more specific
Maybe it's a bit pedantic but we shouldn't be matching
"org.test.Hello.Plugin.fun" when we're trying to match "org.test.Hello",
so add some trailing slashes to prevent that, and change the options on
a few commands so we're only parsing the columns we care about.
2022-01-04 11:47:20 +00:00
Phaedrus Leeds
a0d8a1dcf3 Update variant-schema-compiler to fix build
Fixes https://github.com/flatpak/flatpak/issues/4534

(cherry picked from commit 6cb4a2598e)
2022-01-04 11:45:01 +00:00
JakobDev
b3dbfd9975 Remove Souk from Readme
(cherry picked from commit d9b57b9c95)
2022-01-04 11:44:10 +00:00
Phaedrus Leeds
ffff812957 transaction: Fix signal Since annotations
(cherry picked from commit 20fd994c5c)
2022-01-04 11:43:51 +00:00
Phaedrus Leeds
ea322f3df0 dir: Fix typos in a warning
(cherry picked from commit fd4e9e84cd)
2022-01-04 11:43:51 +00:00
Phaedrus Leeds
ad26c8e1ff SECURITY.md: Update supported branches
(cherry picked from commit 4b89d92dbd)
2022-01-04 11:43:51 +00:00
Phaedrus Leeds
02b8701062 doc/flatpakrepo: Fix a typo
(cherry picked from commit 71a09d47d5)
2022-01-04 11:43:51 +00:00
Phaedrus Leeds
76d5928707 Pedantic typo fix
(cherry picked from commit 93d3cb4704)
2022-01-04 11:43:51 +00:00
Phaedrus Leeds
3f09faeb89 Fix capitalization of "false" in flatpakref keyfiles
g_key_file_get_boolean() only accepts lower case "true" and "false", so
correct some instances of "False" in key files. This makes no functional
difference as long as the error pointer isn't checked since
g_key_file_get_boolean() also returns false when it can't parse the
value as a boolean. But it still seems good to be correct, and someone
could interpret the existence of "IsRuntime=False" as implying that
"IsRuntime=True" will work, which it doesn't.

(cherry picked from commit b098191252)
2022-01-04 11:39:34 +00:00
Phaedrus Leeds
70b4a030c1 doc: Clarify default setting of noenumerate/nodeps options
(cherry picked from commit f94721bef2)
2022-01-04 11:39:20 +00:00
Ping
c9d4ec12bc Update Croatian translation 2021-12-20 09:06:45 -08:00
Aleix Pol
e28b1f3158 Do not forget to pass the actual error message
Several of our users have been reporting this error to me, can never
tell what could be wrong.
2021-12-17 12:32:14 -08:00
Jan Tojnar
973a909c84 run: Use URN for fontconfig DTD
It should not make any difference other than making it in sync with fontconfig
9c46ef4aac
2021-12-17 12:31:46 -08:00
Phaedrus Leeds
ef1c99a6ae Merge pull request #4627 from flatpak/fix-ci-variant-schema-compiler-update
Update variant-schema-compiler to fix build
2021-12-17 12:21:58 -08:00
Phaedrus Leeds
6cb4a2598e Update variant-schema-compiler to fix build
Fixes https://github.com/flatpak/flatpak/issues/4534
2021-12-17 12:07:20 -08:00
Phaedrus Leeds
d4b681ec6c Merge pull request #4612 from JakobDev/soukremove
Remove Souk from Readme
2021-12-03 10:02:03 -08:00
JakobDev
d9b57b9c95 Remove Souk from Readme 2021-12-03 18:16:02 +01:00
Phaedrus Leeds
f513bf4710 Merge pull request #4597 from haaninjo/l10n-sv
Update Swedish translation
2021-11-22 08:32:35 -08:00
Anders Jonsson
10f2be12c3 Update Swedish translation 2021-11-22 16:06:39 +01:00
Phaedrus Leeds
1e081bc411 Merge pull request #4592 from refi64/fix-fish-dir
Fix fish profile script install directory
2021-11-19 09:14:02 -08:00
Ryan Gonzalez
5927260823 Fix fish profile script install directory
Caught by @gasinvein on #4575 post-merge: I didn't realize fish has a
separate folder for config files provided by the vendor vs added by the
user. This changes the install directory to match the vendor config dir.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
2021-11-19 09:34:57 -06:00
Phaedrus Leeds
6d74eec0a9 dir: Verify subsummary checksum from disk cache
Currently we verify the checksum of indexed summary files (which have
.sub file names) before writing them to the on-disk cache, so in theory
as long as the disk I/O is successful the data integrity should be
intact when we use it via the flatpak-variant-impl-private.h helpers
generated by variant-schema-compiler. However in practice people
sometimes hit assertion failures which are what you would expect to see
if the data is corrupt, since GVariant stores some metadata such as the
"offset size" toward the end of the data, and if we read this from
serialized user data instead it will obviously be incorrect. In one case
I was able to acquire the flathub.idx, flathub.idx.sig, and
flathub-x86_64-fad08cfb10713e749f02a0e894b5d577b7e9c4931fdf9d2fdc50364c002bc925.sub
files which reproduce one of the assertion failures, and the sub file
appears to be incomplete, like the writing of it was interrupted.

We use g_file_replace_contents() when saving these to the disk, and when
not replacing an existing file that function writes directly to the
final filename, so if interrupted it would be expected to leave an
incomplete file.

This commit changes the summary file handling so that we verify the
checksum of any indexed subsummary again after reading it from disk. If
it doesn't match we delete the on-disk cache and try fetching from the
network.

Fixes #4127
2021-11-18 15:22:00 +01:00
Phaedrus Leeds
470b321c63 list: Tweak logic for excluding Locale/Debug extensions
The man page states that the --all option for the list command includes
runtime extensions (e.g. that end in .Locale or .Debug) and this is the
case. When --all is omitted, we only show such extensions when the thing
they extend is not already in the list. However when you run a command
like "flatpak list --runtime --columns=application,branch", you get a
list that excludes runtime locale extensions but includes app locale
extensions, since the corresponding apps are not in the list despite
presumably being installed. This doesn't seem like the right behavior,
so tweak the logic so that app locale extensions are excluded when --all
is omitted and --runtime is used.

Strictly speaking the "extension-of" information is not guaranteed to be
present in the deploy data (which acquires it from the metadata), but in
practice it seems to be present for all but Sources extensions, and I
think it should be considered required since we are already using it to
implement functionality elsewhere in Flatpak:
https://github.com/flatpak/flatpak/issues/4585
2021-11-18 15:20:05 +01:00
Phaedrus Leeds
2c4c84ffee app: Don't tab-complete on aliases
Fixes https://github.com/flatpak/flatpak/issues/4036
2021-11-18 15:11:05 +01:00
Phaedrus Leeds
dfde010a49 tests: Fix a comment 2021-11-17 08:43:29 -08:00
Phaedrus Leeds
e5df71fb65 Merge pull request #4527 from flatpak/readme-specify-build-steps
README: Add more helpful build instructions
2021-11-16 13:50:37 -08:00
Phaedrus Leeds
8ebb79a2c6 Move build instructions to HACKING.md
The README was getting long and unweildy
2021-11-16 13:33:13 -08:00
Phaedrus Leeds
5c5e73eaa9 Merge pull request #4583 from flatpak/make-test-logs-prettier
Make test suite logs prettier
2021-11-16 12:21:09 -08:00
Phaedrus Leeds
388c23cfc5 Make test suite logs prettier
This fixes a few issues with the unit test logs that make them ugly:
1. Currently some lines of output from a command will appear after the
   line from xtrace which has the next command, since the command was
   printing to stdout and xtrace uses stderr. E.g. "Installation complete."
   will appear after "+ flatpak --user install -y ..." but it is from the
   previous install command.
2. Lines of output have many spaces after them to pad them to the table
   width but this is not needed for non-fancy output.
3. Lines of output are mixed with output from httpd since they don't end
   with a newline character, e.g. "Installing… ▊
   4%127.0.0.1 - - [16/Nov/2021 00:18:24] "GET /..."
2021-11-16 11:00:34 -08:00
Phaedrus Leeds
d23793294d tests: Use ${FLATPAK} not flatpak
This way the flatpak command is more consistently run under valgrind
when that is enabled.
2021-11-16 09:53:44 +01:00
Phaedrus Leeds
403ce7957f Merge pull request #4574 from gostsdmitry/patch-2
Update hi.po
2021-11-15 15:50:45 -08:00
Dmitry
d9858dbe8b Update hi.po 2021-11-15 15:10:00 -08:00