Commit Graph

4056 Commits

Author SHA1 Message Date
AsciiWolf
3506002e92 Update Czech translation
Closes: #2016
Approved by: alexlarsson
2018-08-27 11:17:27 +00:00
Patrick Griffis
738c11324a Add /proc to blacklist
This doesn't make sense to ever be in the sandbox

Closes: #2008
Approved by: alexlarsson
2018-08-27 11:06:56 +00:00
Will Thompson
9e02d51737 docs: fix title of FlatpakBundleRef section
Closes: #1995
Approved by: alexlarsson
2018-08-27 10:57:16 +00:00
Will Thompson
b0f8736467 installation: document nullability of some arch/branch params
I've inferred this by walking through the code, which ultimately calls
one of flatpak_build_[app|runtime]_ref() which both implement these
defaults.

Closes: #1995
Approved by: alexlarsson
2018-08-27 10:57:16 +00:00
Will Thompson
9cc72ed08f transaction: improve cross-refs for signal parameter docs
Closes: #1995
Approved by: alexlarsson
2018-08-27 10:57:16 +00:00
Will Thompson
98ee688b84 docs: make FlatpakTransactionOperation appear
There were two reasons why no docs for this class appeared in the HTML
documentation:

* flatpak-transaction-operation.xml was not included by
  flatpak-docs.xml.
* all its symbols were listed in <SUBSECTION Standard>, which is hidden
  from the HTML output. It appears that if a section has no visible
  symbols, it's omitted.

Many symbols which belong to FlatpakTransaction were erroneously grouped
with FlatpakTransactionOperation and so also hidden; fix this too.

Closes: #1995
Approved by: alexlarsson
2018-08-27 10:57:15 +00:00
Will Thompson
04846e24b2 transaction: fix signal parameter documentation
I guess these predate the creation of FlatpakTransactionOperation.

Closes: #1995
Approved by: alexlarsson
2018-08-27 10:57:15 +00:00
Will Thompson
a710f36e31 transaction: validate refs
Without this, it's not safe to use 'pref': if there are no slashes in
'ref', 'pref == 0x1', and any attempt to dereference it later in the
function will crash.

Closes: #1995
Approved by: alexlarsson
2018-08-27 10:57:15 +00:00
Will Thompson
6e270190c8 transaction: add docs & introspection annotations
Without explicit annotation, all optional parameters are assumed to be
mandatory, and 'const gchar **locales' is assumed to be a scalar string
input parameter (rather than an array or an in/out) for some reason.

Closes: #1995
Approved by: alexlarsson
2018-08-27 10:57:15 +00:00
Will Thompson
ae269ba390 transaction: add NULL guards in API entry points
Closes: #1995
Approved by: alexlarsson
2018-08-27 10:57:15 +00:00
Will Thompson
61107c56ce transaction: don't critical in finalize if initable_init() failed
If no installation path is specified at construct time, or if it doesn't
exist, priv->dir will be NULL even after initable_init() has been
called.

Closes: #1995
Approved by: alexlarsson
2018-08-27 10:57:15 +00:00
Patrick Griffis
8f924de730 transaction: Print tags on install
This is specifically useful for the `properietary` tag that is
used on flathub.

Closes: #1992
Approved by: alexlarsson
2018-08-27 10:47:10 +00:00
Simon McVittie
155d9116de test-webserver: Be more verbose about what we're doing
Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #1990
Approved by: alexlarsson
2018-08-27 10:36:28 +00:00
Simon McVittie
3224e26b0a Make test scripts bilingual Python 2/Python 3
Signed-off-by: Simon McVittie <smcv@debian.org>
Forwarded: https://github.com/flatpak/flatpak/pull/1990

Closes: #1990
Approved by: alexlarsson
2018-08-27 10:36:28 +00:00
Simon McVittie
bf31305618 tests: Remove vestigial support for putting Python 2 in a runtime
This is only used in the flatpak-builder tests now, not the main
flatpak tests.

Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #1990
Approved by: alexlarsson
2018-08-27 10:36:28 +00:00
Simon McVittie
13fee9a9ee tests: Look for httpcache in ${test_builddir}, not PATH
For installed-tests, the installed test directory is not on the PATH.
To make this easier, put the uninstalled binary in tests/, so that
in both build-time and installed tests, it is in ${test_builddir}.

Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #1989
Approved by: alexlarsson
2018-08-27 10:26:08 +00:00
Simon McVittie
ae0d7943a5 build: Install httpcache if installed-tests are enabled
Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #1989
Approved by: alexlarsson
2018-08-27 10:26:08 +00:00
Christian Kirbach
ba28e59c9d Update German translation
translation proof-read by the German GNOME team
Closes: #2022
Approved by: alexlarsson
2018-08-27 10:15:56 +00:00
Alexander Larsson
0307afd5f2 Fix hang in system-herlpe::DeplayAppstream for OCI
When deploying the appstream for an OCI remote we actually pull the
http remote. This triggers some libsoup code that recurses the default
mainloop. As this happens of the main thread we can get the response
back on the wrong thread leading causing us to never send the reply
back, hanging the call.

Closes: #2010
Approved by: alexlarsson
2018-08-26 09:29:39 +00:00
Alexander Larsson
7b8e9ea4a1 dbus xml: Delete -- from docs
Apparently -- is not valid XML, so a nonbreakable space was added, but
that breaks gdbus-codegen, so lets just drop the dashes totally.

Closes: #1988
Approved by: alexlarsson
2018-08-20 13:17:40 +00:00
Alexander Larsson
a7c88682d3 Don't use G_NUMBER_PARSER_ERROR as it requires a newer glib
Closes: #1987
Approved by: alexlarsson
2018-08-20 10:42:21 +00:00
Alexander Larsson
5545ac4ba6 Update po/ 1.0.0 2018-08-20 11:48:57 +02:00
Alexander Larsson
c95605962e Bump version to 1.0.0 2018-08-20 11:23:01 +02:00
Alexander Larsson
57477f50c0 NEWS: Tweak release text a bit 2018-08-20 11:23:01 +02:00
Alexander Larsson
3f3625819b Dist tests/oci-registry-[server|client].py
These are needed for make distcheck to pass.
2018-08-20 10:50:57 +02:00
Alexander Larsson
1550b0ad0e iUpdate NEWS for release 2018-08-20 10:11:15 +02:00
Matthew Leeds
37ad100cfe dir: Quietly refuse to downgrade ostree-metadata
This reverts commit ed1d7eacf4 and fixes
the issue in a different way.

With the introduction of peer (LAN/USB) sources of refs comes a problem:
they may have outdated repository metadata (which is stored as
contentless commits on the branch "ostree-metadata"). Currently Flatpak
allows the older metadata to be pulled into the local repo, but this is
undesirable for a few reasons: it hurts the security properties of the
system because for example the GPG keys might have been rotated and you
don't want to go back to using the old ones, and it's undesirable
because the old metadata might have missing or wrong information about
the apps installed on the system.

So this commit makes Flatpak ignore the downgrade and use the newer
metadata for the offline operation. This is not a perfect solution,
because the newer metadata might have information (such as the download
size or needed runtime) that's not accurate for the old versions of the
refs that are available offline. This issue is significantly mitigated
by the fact that FlatpakTransaction operations use commit metadata to
make decisions, rather than depending on the xa.cache.

Another possible solution would be to read the outdated metadata into
the FlatpakRemoteState object without pulling it into the local repo or
using it to update the remote config, but that's not perfect either
because there's no guarantee you'll pull the metadata from the same
source as the refs (perhaps one comes from a USB drive and the other
from a LAN peer). Longer term, we should figure out how to rely less on
the xa.cache (which is stored in ostree-metadata) or otherwise make
architectural changes to solve those issues. For now, I think this fix
will be enough to make USB updates usable and secure.

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

Closes: #1965
Approved by: alexlarsson
2018-08-20 06:58:01 +00:00
Matthew Leeds
fb989a62a1 common: Add and use FLATPAK_ERROR_DOWNGRADE
This will be useful in distinguishing downgrade errors from other
errors, which I'll need in the next commit.

Closes: #1965
Approved by: alexlarsson
2018-08-20 06:58:01 +00:00
Matthew Leeds
1ff0cf8c16 common: Register all FlatpakError codes as D-Bus errors
This will allow us to return anything in the FlatpakError domain using
g_dbus_method_invocation_return_gerror().

Closes: #1965
Approved by: alexlarsson
2018-08-20 06:58:01 +00:00
Piotr Drąg
9fe1c60807 Update Polish translation
Closes: #1986
Approved by: alexlarsson
2018-08-19 22:08:37 +00:00
Matthew Leeds
792a5c0606 transaction: Print newline character after error messages
Closes: #1979
Approved by: alexlarsson
2018-08-17 09:34:34 +00:00
Matthew Leeds
5cff4500a2 transaction: Fix error handling for related refs
This commit fixes the handling of errors from installing/updating
related refs during a transaction, so that they're treated as non-fatal,
and so that the operation is skipped if the primary operation fails. The
current behavior is that a failure to install/update a related ref
causes the whole transaction to fail, and even after a failure to
install/update the primary ref the related ref install/update is
attempted.

I hit this error when doing an offline USB app install, when the USB
repo has an older version of the runtime and the runtime's locale
extension than what's in the local repo. Without this commit, the
failure to update the runtime (due to it being a downgrade) is treated
as a warning, but the failure to update the runtime locale is treated as
an error. With this commit, the runtime update failure is still treated
as a warning, and the locale update is not attempted. This is better
behavior because the locale extension update (or even install) is not
critical to the app install.

Closes: #1979
Approved by: alexlarsson
2018-08-17 09:34:34 +00:00
Alexander Larsson
ef9297a0f1 dbus-proxy: Fix handling of broadcasts
In https://github.com/flatpak/flatpak/pull/1689 we were meant to
have limited the receiving of broadcasts on portals, but die to a
bug in the proxy we accidentally allowed all broadcasts anyway.

The change which ignores all applied filters < POLICY_TALK fixes that.

However, it also turns out that the desktop portal actually *does*
rely on signals. For example the network portal uses property change
notification.

So, to make sure this works we allow all signal from the portal
names, but only if they are on a object path starting under
/org/freedesktop/portal (which incidentally all portal object are).
This means there is no real change in anything that is currently
deployed, but it does allow portals to opt out of this global signal
visiblity if they want by using a different object path, which we
want to use in dconf.

Closes: #1976
Approved by: alexlarsson
2018-08-17 09:24:13 +00:00
Matthew Leeds
cbc0046554 transaction: Fix a regression in installing bundles
This commit fixes a regression that causes installing from a bundle to
fail if the bundled app's runtime was itself installed from a bundle, or
otherwise has a non-working remote (such as when the user is offline).

The fix is to treat a failure of flatpak_dir_find_latest_rev() as
non-fatal in resolve_ops() if the ref in question is already installed.
In other words, if we don't need to fetch a ref for the transaction to
succeed, errors in fetching remote info about the ref shouldn't be
fatal.

Closes: #1973
Approved by: alexlarsson
2018-08-17 09:14:26 +00:00
Matthew Leeds
1fcffc8950 create-usb: Properly handle copying subpaths
Currently the create-usb command reads the subpaths listed in the
flatpak deploy data and just passes those to the ostree pull operation
to copy them to the USB. But this is not the correct way to handle them,
and leads to installs from the USB failing in the case where the locale
is partial (more specifically the install of the main ref succeeds but
the install of the locale extension doesn't).

So this commit changes create-usb to handle subpaths the same way
flatpak_dir_pull() and flatpak_dir_deploy() do, which is to copy the
/metadata path along with a subdirectory of /files for each listed
subpath. So in the case of an English partial locale, /metadata and
/files/en will be copied to the USB drive, and those are the subpaths
that will be pulled during the install (if the installing computer also
uses English).

Closes: #1972
Approved by: alexlarsson
2018-08-17 09:04:24 +00:00
Matthew Leeds
9616737c0b dir: Fix a subpath checkout error message
In this loop we're checking out a subpath under /files, not /metadata,
so fix the error message.

Closes: #1970
Approved by: alexlarsson
2018-08-17 08:45:36 +00:00
Matthew Leeds
4c5fc20d60 common: Improve "No xa.metadata" error messages
When I run `flatpak update` I get messages saying "Warning: No
xa.metadata in commit" which isn't very helpful without knowing what
commit is being referred to. So this commit adds the checksum and ref to
such error messages.

Closes: #1978
Approved by: alexlarsson
2018-08-17 08:35:07 +00:00
Matthew Leeds
76a5c63c19 doc/flatpak-build-bundle.xml: Add a usage example
In the output of `flatpak build-bundle --help` it's not clear what
LOCATION is, so the least we can do is add an example of its usage to
the man page. At some point it would be nice to also have explanations
of positional arguments in help output.

Closes: #1974
Approved by: alexlarsson
2018-08-17 08:24:33 +00:00
Matthew Leeds
425940f0c3 create-usb: Fix a leak of the list of extensions
This only fixes the leak when we don't hit an error condition. To fix it
in that case we need an autoptr for deep lists.

Closes: #1966
Approved by: alexlarsson
2018-08-17 08:13:15 +00:00
Alexander Larsson
6bb492cb6b test: Suppress weird thread-related stream leak in ostree
Closes: #1966
Approved by: alexlarsson
2018-08-17 08:13:15 +00:00
Alexander Larsson
341ad02193 flatpak_dir_remote_make_oci_summary: Actually use cache
We need to return early on cache hits.

Closes: #1966
Approved by: alexlarsson
2018-08-17 08:13:15 +00:00
Alexander Larsson
9cc0f0d404 Fix leak in flatpak_cache_http_uri
Need to free the return value of soup_header_parse_param_list

Closes: #1966
Approved by: alexlarsson
2018-08-17 08:13:15 +00:00
Alexander Larsson
3d9a616632 flatpakref: Fix leak of gpg key string
Closes: #1966
Approved by: alexlarsson
2018-08-17 08:13:15 +00:00
Matthew Leeds
c3a0617557 NULL initialize g_auto variables
It's a good idea to NULL initialize g_autoptr/g_autofree variables, so
we can be sure uninitialized memory isn't passed to g_free or similar.

Closes: #1968
Approved by: alexlarsson
2018-08-17 08:06:51 +00:00
Matthew Leeds
745287e48f dir: Fix another GVariant leak
g_variant_builder_end() returns a floating reference, so sink it.

Closes: #1964
Approved by: mwleeds
2018-08-13 21:31:10 +00:00
Alexander Larsson
fe66d412ff build-commit-from: Fix gvariant leaks
ostree_repo_pull, etc does not sink the options variant, so
make sure to ref-sink it ourselves.

Closes: #1964
Approved by: mwleeds
2018-08-13 21:31:10 +00:00
Alexander Larsson
b8eb940795 build-commit-from: Fix some leaks
Use &s to get child strings, otherwise we get a copy.

Closes: #1964
Approved by: mwleeds
2018-08-13 21:31:09 +00:00
Alexander Larsson
75adff05f4 flatpak-json: Don't leak empty optional nodes.
Closes: #1964
Approved by: mwleeds
2018-08-13 21:31:09 +00:00
Alexander Larsson
4b8624e705 flatpak_yes_no_prompt: Fix leak of formated string
Closes: #1964
Approved by: mwleeds
2018-08-13 21:31:09 +00:00
Alexander Larsson
a6bec60d24 flatpak_dir_find_remote_related_for_metadata: Fix leak
Move extension_ref into the loop so its freed every iteration.

Closes: #1964
Approved by: mwleeds
2018-08-13 21:31:09 +00:00