Commit Graph

3366 Commits

Author SHA1 Message Date
Alexander Larsson
69d81df46f Add flatpak_exports_add_home_expose
This means we don't have to poke at exports internals

Closes: #1374
Approved by: alexlarsson
2018-02-05 14:31:30 +00:00
Alexander Larsson
8ef735369d Break out FlatpakBwrap to its own file
This is pure code motion

Closes: #1374
Approved by: alexlarsson
2018-02-05 14:31:30 +00:00
Alexander Larsson
eb692a9bb8 Move buffer_to_sealed_memfd_or_tmpfile to flatpak-utils.h
Closes: #1374
Approved by: alexlarsson
2018-02-05 14:31:30 +00:00
Alexander Larsson
71648bb1bf flatpak-run: Rename and expose some FlatpakExports functions
This is in preparation for moving the implementation to another file.

Closes: #1374
Approved by: alexlarsson
2018-02-05 14:31:30 +00:00
Alexander Larsson
58b25843b5 Add and use flatpak_context_allows_features
This lets us avoid directly dereferencing FlatpakContext

Closes: #1374
Approved by: alexlarsson
2018-02-05 14:31:30 +00:00
Alexander Larsson
0a09db6c1c flatpak-run: Use flatpak_context_get_needs_system_bus_proxy
Closes: #1374
Approved by: alexlarsson
2018-02-05 14:31:30 +00:00
Alexander Larsson
6296987a45 Move dbus filter argument generation to flatpak-context
Closes: #1374
Approved by: alexlarsson
2018-02-05 14:31:30 +00:00
Alexander Larsson
447a8d0537 Extract FlatpakContext to a separate file
This is basically a code motion only, no changes to behaviour.

Closes: #1374
Approved by: alexlarsson
2018-02-05 14:31:30 +00:00
Alexander Larsson
d745b14d60 Add flatpak_context_load_for_deploy()
Closes: #1374
Approved by: alexlarsson
2018-02-05 14:31:30 +00:00
Matthew Leeds
27c109546c README: Fix link to command reference
flatpak.org no longer hosts the HTML command reference, but it's on
docs.flatpak.org so change the link to that.
2018-02-03 11:33:52 -08:00
Matthew Leeds
3034267adf README: Use HTTPS for flatpak.org link 2018-02-03 11:32:19 -08:00
Daniel Aleksandersen
1deff2544a common/table-printer: separate columns with tab in non-TTY stdout
Makes table output parsable for scripting.

Closes: #1354
Approved by: mwleeds
2018-02-02 16:17:06 +00:00
Robert McQueen
a088c2b33d flatpak remote-ls -u: only consider apps from the current remote
Check that the origin from the deploy matches the current remote
before listing it as an upgrade.

Closes: #1373
Approved by: mwleeds
2018-02-02 05:37:52 +00:00
Robert McQueen
f73357cc5b extract_appstream: debug if an exported appstream is skipped
We had missing icons for a few apps due to this - if this ever happens
it means something very weird is going on with the export process in
a flatpak, so it's probably worth alerting the repo admin.

Closes: #1367
Approved by: pwithnall
2018-01-31 18:34:18 +00:00
Robert McQueen
6ab657b910 extract_appstream: allow component IDs not to end in .desktop
The appstream spec suggests that IDs should end in .desktop, but does
not require it. Make the repo appstream update process permit this
so that the appstream and icons are extracted correctly.

Closes: #1367
Approved by: pwithnall
2018-01-31 18:34:18 +00:00
Kalev Lember
bffca5733e common/dir: Fix a memory leak
Closes: #1369
Approved by: mwleeds
2018-01-31 18:03:16 +00:00
Matthew Leeds
aabd44fb8a doc: Fix refentry id in flatpak-build-sign.xml
The id value in flatpak-build-sign.xml is "flatpak-build-export", which
causes the generated HTML to link to that command instead. Fix it.
2018-01-30 23:34:10 -08:00
Alexander Larsson
52346bf187 Fix vulnerability in dbus proxy
During the authentication all client data is directly forwarded
to the dbus daemon as is, until we detect the BEGIN command after
which we start filtering the binary dbus protocol.

Unfortunately the detection of the BEGIN command in the proxy
did not exactly match the detection in the dbus daemon. A BEGIN
followed by a space or tab was considered ok in the daemon but
not by the proxy. This could be exploited to send arbitrary
dbus messages to the host, which can be used to break out of
the sandbox.

This was noticed by Gabriel Campana of The Google Security Team.

This fix makes the detection of the authentication phase end
match the dbus code. In addition we duplicate the authentication
line validation from dbus, which includes ensuring all data is
ASCII, and limiting the size of a line to 16k. In fact, we add
some extra stringent checks, disallowing ASCII control chars and
requiring that auth lines start with a capital letter.
2018-01-30 12:06:14 +01:00
Alexander Larsson
3c9d3a316e Fix incorrect error message in update --appstream
When the specified remote existed, but had no updates we printed
a message like:  error: Remote "flathub" not found

Closes: #1363
Approved by: alexlarsson
2018-01-30 10:54:28 +00:00
Alexander Larsson
858534069e Ignore unknown permission requests
When loading data from e.g. an installed app we ignore any permissions
it requests that we don't know about, rather than failing. This allows
us to later add permissions in an optional way. If the added permissions
are not optional you can use the flatpak-version key to request a specific
flatpak version that supports them.

Closes: #1362
Approved by: alexlarsson
2018-01-30 10:37:08 +00:00
Matthew Leeds
01fe49c66b common/dir: Fix typo in debug message 2018-01-29 00:57:10 -08:00
Meskó Balázs
39a91e899f Update Hungarian translation
Closes: #1347
Approved by: mwleeds
2018-01-29 06:55:41 +00:00
AsciiWolf
9496922ff7 Update Czech translation
Closes: #1342
Approved by: mwleeds
2018-01-29 06:48:07 +00:00
Philip Withnall
46db046b55 lib: Fix wording in a g_warning()
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1338
Approved by: mwleeds
2018-01-25 17:32:36 +00:00
Jan Grulich
c226288dd6 Document portal: implement add_named_full() function
This is a convenient function which can be used with flags, adding option to return
real path of the file we are trying to open in case the sandboxed app has access
to it. It also registers this file automatically to document store so there is no
need to call grant_permission() afterwards.

Closes: #1335
Approved by: alexlarsson
2018-01-25 09:22:21 +00:00
Sam Spilsbury
31bd2912e1 lib: Document that flatpak_installation_update_fulls throws if up to date
This is not the ideal outcome, but it does avoid breaking
behaviour stability across versions.

Fixes #1336

Closes: #1337
Approved by: alexlarsson
2018-01-25 09:10:26 +00:00
Kukuh Syafaat
41399b2e6b update Indonesian translation 2018-01-24 11:29:24 +01:00
Matthew Leeds
6c9d43d67f remote-info: Show collection ID if available
If flatpak is compiled with P2P support and the commit in question has a
collection ID in its metadata, show it.

Closes: #1312
Approved by: alexlarsson
2018-01-24 09:58:16 +00:00
Matthew Leeds
bf07d6b596 remote-info: Fix --show-metadata behavior
When the --show-metadata option is used with remote-info, the metadata
variable is never initialized, causing flatpak to print "(null)". This
commit makes sure the variable is properly initialized so the metadata
prints correctly.

Closes: #1313
Approved by: alexlarsson
2018-01-24 09:48:51 +00:00
Jan Grulich
a7c0d4ce56 Add DBus annotations
Closes: #1332
Approved by: alexlarsson
2018-01-23 09:30:19 +00:00
Iceyer
1cea02a2f6 common: Fix division by zero when calculate progress
Closes: #1331
Approved by: alexlarsson
2018-01-23 09:22:36 +00:00
John
30e5bbc45f Update info on Arch user namespaces in README.md
As of linux kernel 4.14.5, user namespaces are enabled on Arch with the standard linux kernel.

Username spaces are disabled by default, but can be enabled with the
kernel.unprivileged_userns_clone sysctl.

More information regarding the change can be found in the Arch Linux bug report:
https://bugs.archlinux.org/task/36969
Closes: #1328
Approved by: cgwalters
2018-01-19 23:10:19 +00:00
Philip Withnall
7d1da19de2 common/dir: Add a missing OstreeAsyncProgress default key
oci_pull_init_progress() seems to set all the default keys wanted by
ostree_repo_pull_default_console_progress_changed() except the
caught-error key, which was added in OSTree commit 5c4f26bd65b492.

Add that key, just in case something queries for it (if it’s missing
when that happens, an assertion failure will be hit).

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1320
Approved by: cgwalters
2018-01-19 23:01:03 +00:00
Dan Nicholson
a5b5e742fd lib/installation: Fix install/update_full() subpaths annotation
Mark subpaths as a NULL terminated array. Without this the GIR makes
this a single utf8 parameter and bindings can't use it.

Closes: #1327
Approved by: cgwalters
2018-01-19 22:53:06 +00:00
Matthew Leeds
ee10c43b66 dir: Fix typos in comments 2018-01-15 22:54:27 -08:00
Matthew Leeds
d9e4041eb1 app: Fix "multiple installations" prompt
When a remote is found in multiple installations and we ask "Which do
you want to use (0 to abort)?", the 0 choice isn't working because the
min value in the call to flatpak_number_prompt() was set to 1. Fix that
so the user can abort if they want.

Fixes https://github.com/flatpak/flatpak/issues/1305
2018-01-14 23:33:43 -08:00
Philip Withnall
b148160986 common/dir: Use an actual function for autoptr support without P2P
When building with --disable-p2p, we create a stub type for
OstreeRepoFinderResult and OstreeRepoFinderResultv to avoid having to
add #ifdefs around all uses of them throughout the code base. We also
need to create autoptr functions for them so that the code can continue
to use g_autoptr(OstreeRepoFinderResult).

Previously, we were using `void` as the GDestroyNotify function for the
stub types. This wasn’t valid (it’s not a function), but it worked.

Since g_autolist() support has landed in GLib, this has broken. Fix it
by using a static inline no-op function as the GDestroyNotify function
instead. This should never be called, so exists purely to get things to
compile.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://github.com/flatpak/flatpak/issues/1279

Closes: #1293
Approved by: mwleeds
2018-01-04 19:34:19 +00:00
Piotr Drąg
c60b5d7e7c Update Polish translation
Closes: #1273
Approved by: mwleeds
2017-12-28 22:54:21 +00:00
Matthew Leeds
ff3d2097ac dir: Fix a few comments 2017-12-27 18:07:41 -06:00
Alexander Larsson
85282668ec deploy: Create the binary wrappers after having rewritten the exports
Interestingly the telegram appid is "org.telegram.desktop", which means
the wrapper ends up having a .desktop extension which confuses the
desktop file exporter. We fix this by rewriting any exports before
creating the wrappers.

Fixes https://github.com/flathub/org.telegram.desktop/issues/18

Closes: #1270
Approved by: alexlarsson
2017-12-21 09:49:53 +00:00
Alexander Larsson
006a5f2ade Don't crash when installing bundles that have no embedded URIs
Closes: #1268
Approved by: alexlarsson
2017-12-21 08:33:46 +00:00
Philip Withnall
89243b1d9c common/dir: Don’t ignore errors when marking dir as changed
Coverity CID: 1462265

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1267
Approved by: alexlarsson
2017-12-20 13:03:37 +00:00
Philip Withnall
0afa7acf9b common/dir: Don’t ignore errors replacing a file on undeploy
Emit a warning about them rather than ignoring them entirely.

Coverity CID: 1376554

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1267
Approved by: alexlarsson
2017-12-20 13:03:37 +00:00
Philip Withnall
6f5fef5501 app/main: Fix error handling for getting system dir list
The error wasn’t being propagated properly, leading to a NULL pointer
dereference.

Coverity CID: 1463075

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1267
Approved by: alexlarsson
2017-12-20 13:03:37 +00:00
Philip Withnall
955fbc29bf common/dir: Fix various big and small leaks
Some of these were leaking entire file contents, or the whole of
xa.metadata.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1259
Approved by: mwleeds
2017-12-19 07:12:28 +00:00
AsciiWolf
e00ac4b043 Update Czech translation
Closes: #1261
Approved by: mwleeds
2017-12-19 05:42:35 +00:00
AsciiWolf
9e92bef562 main: Fix typo in translatable string
Closes: #1260
Approved by: mwleeds
2017-12-15 23:52:54 +00:00
Alexander Larsson
0ff893827f Update to 0.11.1 on master 2017-12-15 16:24:32 +01:00
Alexander Larsson
648f74b324 Update pofiles for release 0.10.2 2017-12-15 13:34:23 +01:00
Alexander Larsson
beeb7e23c9 Update NEWS for release 2017-12-15 13:27:58 +01:00