2352 Commits

Author SHA1 Message Date
Alexander Larsson
a925df9e4a Update pofiles 0.8.5 2017-04-03 14:15:18 +02:00
Alexander Larsson
1f86f955b7 Update version to 0.8.5 2017-04-03 14:07:32 +02:00
Alexander Larsson
098db9d040 Update NEWS for release 2017-04-03 14:07:07 +02:00
Alexander Larsson
426189ab89 Handle uris better when detecting .flatpak[repo,ref] suffix
We fully parse the argument as (possibly) a uri, which means
we can handle an argument like:
 https://git.gnome.org/browse/gnome-apps-nightly/plain/gnome-builder.flatpakref?h=stable

Which doesn't work with a simple has_suffix call.
This is important because the flatpak.org site now references
these kinds of uris.

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

(cherry picked from commit 0dcc7332f7)
2017-04-03 13:46:31 +02:00
Alexander Larsson
b30a731ca4 update: Only allow downgrades if a commit is explicitly specified
If you run "flatpak update" then we will never update to
a commit that is older than the currently installed one. This
protects against a man-in-the-middle attack that would otherwise
let the attacker downgrade to a previously signed version that
may have some vulnerability.

(cherry picked from commit 3ff6d312de)
2017-04-03 13:44:28 +02:00
Alexander Larsson
f34398a4ec system-helper: Fix check for downgrade
We never want the system-helper to downgrade. If you want to run
not-the-latest version you need to be "real root". However, the
check for this was broken, as it compared the new commit with the
new commit, which was always ok. Instead check the timestamp
on the new commit with the current one.

(cherry picked from commit 266b9cb6f0)
2017-04-03 13:44:24 +02:00
Alexander Larsson
07c8997a43 dbus-proxy: Fix leak in setup phase
Sometimes we get an EAGAIN error in the due to the socket being
nonblocking. In the setup phase we just allocated the new buffer
and this causes a leak. Free it in this case.

(cherry picked from commit 6a63a905bf)
2017-04-03 13:44:16 +02:00
Alexander Larsson
8f2755cd47 dbus-proxy: Fix leak of get_arg0_string return value
In one place this was not freed. This converts both current
callers to g_autofree to make it consistent.

(cherry picked from commit a87c15da87)
2017-04-03 13:44:16 +02:00
Alexander Larsson
9d04e5dc98 dbus: proxy fix leak in get_arg0_string
g_variant_get_child_value returns a new reference, so we have to free
it.

(cherry picked from commit 0c05d48aca)
2017-04-03 13:44:16 +02:00
Alexander Larsson
f1e94adfa7 dbus-proxy: Fix use-after free in header parsing
The header returned from parse_header contains references
to the buffer it was used to parse from, and in some
cases we dereference these headers after freeing the buffer.
For instance this happens when we're filtering a message, and
then we later look at the destination to figure out what
kind of error to send back.

I couldn't find any cases where this would let the client
do anything other than return a different error value, but
this is still possibly a security issue.

(cherry picked from commit 18a45712cc)
2017-04-03 13:44:16 +02:00
Alexander Larsson
a19a706f56 dbus-proxy: Make Buffer refcounted
This will be needed to fix some user-after-free issues.

(cherry picked from commit 557f9231a2)
2017-04-03 13:44:16 +02:00
Colin Walters
0082bd53e6 utils: Prepare for libostree 2017.4 defining autocleanups
See: https://github.com/ostreedev/ostree/pull/756
2017-04-03 13:44:00 +02:00
Alexander Larsson
1018d05cda Stop using ostree trivial-httpd
This isn't always available in recent ostree.
This work is based on https://github.com/flatpak/flatpak/pull/658 and
fixes https://github.com/ostreedev/ostree/pull/723
2017-04-03 13:43:56 +02:00
Alexander Larsson
ea04835008 Correctly find system unmaintained extensions
We should not terminate the extension search just because
an earlier directory succeeds. Even non-existant directories
succeed, and anyway we should continue searching even if it
wasn't empty, because multiple subdir extensions may match.

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

(cherry picked from commit 82aad1ccb1)
2017-04-03 13:30:43 +02:00
Alexander Larsson
98d770ab59 Re-fix typo
(cherry picked from commit d7f2bf000e)
2017-04-03 13:29:24 +02:00
Alexander Larsson
c78f91b296 Update minimal automake to 1.13.4
It doesn't build on the current minimum of 1.11.
Fixes https://github.com/flatpak/flatpak/issues/621

(cherry picked from commit afc2dd3d75)
2017-04-03 13:27:56 +02:00
Alexander Larsson
bc84c98fff Bump glib dependency to 2.44
This is required for e.g. G_DECLARE_FINAL_TYPE, and most current
distros have this now.

This fixes https://github.com/flatpak/flatpak/issues/622

For distributions that want to build against older glib, see
the issue above, it has patches to make that work.

(cherry picked from commit dcccb3c807)
2017-04-03 13:27:52 +02:00
Alexander Larsson
7e18ec30b2 Update potfiles 0.8.4 2017-03-10 11:01:34 +01:00
Alexander Larsson
224d706a83 Bump version to 0.8.4 2017-03-10 10:43:30 +01:00
Alexander Larsson
a9b8ba5f42 Update NEWS 2017-03-10 10:43:07 +01:00
Alexander Larsson
f09d6b3aa6 profile: Don't add flatpak to XDG_DATA_DIRS if its already there 2017-03-10 10:42:44 +01:00
Georges Basile Stavracas Neto
5bb3c05e14 Fix comment
(cherry picked from commit 556782ac06)
2017-03-10 10:20:27 +01:00
Georges Basile Stavracas Neto
753e487fbf Improve progress calculation
When calculating the progress of a flatpak installation,
it considers the extra-data and OSTree pull as different
operations and that makes the progress to go back and
forth between 0% and 100%.

Consumers of this API, like GNOME Software, end up having
a bad experience reporting the progress of a Flatpak app
instalation.

Fix that by using a set of heuristics to improve the process,
splitting the operation in parts that can be tracked (or at
least estimated).

(cherry picked from commit d74956c23a)
2017-03-10 10:20:24 +01:00
Georges Basile Stavracas Neto
a0b3f74587 Split extra-data setup and fetch
By splitting the extra-data setup - where we set the number of
extra-data downloads and auxiliary information - and download -
where we actually fetch the extra-data - we can have more precise
progress reports.

(cherry picked from commit d73090cc96)
2017-03-10 10:20:21 +01:00
Alexander Larsson
efa282f9ea appstream: Don't add runtime to flatpak bundle tag for runtimes
(cherry picked from commit 7d1a8f69f6)
2017-03-10 10:20:18 +01:00
Elvis Angelaccio
e536497d3f Append flatpak data dirs if XDG_DATA_DIRS is already set (#611)
* Append flatpak data dirs if XDG_DATA_DIRS is already set

Otherwise it will be impossible to run flatpak apps from desktop menus.
This issue can happen if another app (e.g. snapd) wants to add custom
folders to XDG_DATA_DIRS through /etc/profile.d

If XDG_DATA_DIRS is empty or unset, define it as before.

Fixes #606

(cherry picked from commit a9acdc0532)
2017-03-10 10:20:14 +01:00
Matthew Leeds
870ee12a74 doc: Make manpages consistent with --help output
For a few commands the options aren't fully documented. This commit
makes the manpage documentation (almost) match the options shown
when you run "<command> --help" on the command line.

(cherry picked from commit 2d07f7d455)
2017-03-10 10:19:52 +01:00
Matthew Leeds
c6417dbb81 doc: Fix typos
(cherry picked from commit d9272ab120)
2017-03-10 10:19:52 +01:00
Matthew Leeds
541d8ff1b0 doc: Fix example for flatpak-info command
(cherry picked from commit 4817421289)
2017-03-10 10:19:52 +01:00
Alexander Larsson
69d32a6331 extensions: Support multiple versions
This means an extension point can include extensions of multiple
(specified) versions. This is useful for e.g. the GL extensions,
where we want a single extension for all the essentially unversioned
GL extensions (like the nvidia one) that is used by all the
runtimes.

(cherry picked from commit 640a02315b)
2017-03-06 14:37:53 +01:00
Alexander Larsson
c68d6a6428 flatpak_list_extensions: Break out code into helper
This is a minor restructure to make the code more readable
and extensible.

(cherry picked from commit 3122d1c014)
2017-03-06 14:37:53 +01:00
Matthias Clasen
eb858a2643 Merge pull request #600 from piotrdrag/pl-update-170303-0.8.x
Update Polish translation for flatpak-0.8.x 170303
2017-03-03 05:45:45 -05:00
Piotr Drąg
715f599acf Update Polish translation 2017-03-03 08:38:49 +01:00
Alexander Larsson
8bd07ca2a0 Support runtime-less extra-data
This is going to be needed for the nvidia driver to solve
https://github.com/flatpak/flatpak/issues/595

(cherry picked from commit 62286cf779)
2017-02-28 19:54:37 +01:00
Alexander Larsson
c216d989a8 Fix error check when loading configuration
(cherry picked from commit 78b5c2fbf5)
2017-02-28 19:54:32 +01:00
Alexander Larsson
0869586e47 zero-mtime: Handle error when enumerating directory
(cherry picked from commit 9d9bd184c7)
2017-02-28 19:54:27 +01:00
Alexander Larsson
91f91b5994 run: Handle error when enumerating /etc
(cherry picked from commit d24c5f1423)
2017-02-28 19:54:23 +01:00
Alexander Larsson
9940d0c420 list-remotes: Handle remotes with no url specified
(cherry picked from commit e3d8e0df04)
2017-02-28 19:54:18 +01:00
Alexander Larsson
02c84454a4 list: Don't check error twice
(cherry picked from commit 2e639b81e2)
2017-02-28 19:54:07 +01:00
Alexander Larsson
4adb1c21ad utils: Fix flatpak_bundle_load typo
If we failed to look up the app metadata we would
clear out a different out argument instead.

(cherry picked from commit 4db1e74090)
2017-02-28 19:53:50 +01:00
Alexander Larsson
20b872d2ce Avoid possible null dereference
If the link fails to resolve the return value will be NULL, so we shouldn't use
it before checking for NULL.

(cherry picked from commit b2b6dd3af2)
2017-02-28 19:53:45 +01:00
Alexander Larsson
d0e927a538 utils: Fix list_unmtainained_refs
There was a stray goto out that caused it to only look at the first
element in the system dirs list.

(cherry picked from commit e1e27559d1)
2017-02-28 19:53:36 +01:00
Richard Hughes
48e0543661 Don't include newlines in error messages
(cherry picked from commit d2307ca8b1)
2017-02-28 19:53:22 +01:00
Richard Hughes
ae45231173 Return the container from flatpak_get_system_installations()
This matches what other functions in libflatpak do, and also fixes a memory
leak in the error path.

(cherry picked from commit 6125dabf58)
2017-02-28 19:52:46 +01:00
Alexander Larsson
5591f60519 document portal: Disable spice_read as it seems broken
We're getting "fuse: copy from pipe: short read" from
libfuse and a broken filesystem with this. See
https://github.com/flatpak/flatpak/issues/570

I've tried to look into if this is fixable, but I can't
really find any way we could do things differently that
may help, so the fix is to disable spice_read.

(cherry picked from commit 4fdac9e5d4)
2017-02-27 11:44:44 +01:00
Mario Sanchez Prada
a44b6191d7 Initialize g_autofree string to NULL, not to crash when early returning
Otherwise, anytime we fail in ostree_repo_write_metadata() will cause
an invalid free to happen, and flatpak to crash.

(cherry picked from commit d0b5b51076)
2017-02-27 11:44:36 +01:00
Alexander Larsson
ff3c34b5ad update: Don't update related refs from different remote
In case you happen to have a reference A with a related reference
B (say a runtime and a GL extension), and they come from different
remotes, then updating A should not cause B to update from the same
remote as A, but rather the current remote.

(cherry picked from commit 6793d90b82)
2017-02-27 11:44:30 +01:00
Alexander Larsson
5b29eebf9e Fix repeated download of locates on update
When we update an app and add updates for all the related
operations, such as locates, and it is already installed,
make sure we inherit the current subpaths rather than
use the default ones.

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

(cherry picked from commit 51e14fe33b)
2017-02-27 11:44:21 +01:00
Alexander Larsson
37a19ce172 Don't remove origin remotes if some other ref uses it
This fixes https://github.com/flatpak/flatpak/issues/586

(cherry picked from commit cc03a2b94b)
2017-02-27 11:43:53 +01:00
Ray Strode
24632dab0b run: propagate wildcard xauth entries to app bundle
At the moment, flatpak applications are only given FamilyLocal family
xauth cookies from the Xauthority file.  This is so, the sandboxed
application doesn't inadvertently get access to displays on other
computers.

But FamilyLocal isn't the only xauth family that's local.  FamilyWild
entries can be local as well.

Furthermore, FamilyWild entries are preferable to FamilyLocal entries
when found, because they don't break if the system hostname is changed.

This commit makes FamilyWild xauth entries get propagated in the same
way as their FamilyLocal counterparts.

(cherry picked from commit a82708cb10)
2017-02-27 11:43:16 +01:00