Commit Graph

7164 Commits

Author SHA1 Message Date
Patrick Griffis
0f33ba53ff Add search builtin
This allows searching for applications easily greatly improving
the UX of the cli. This relies upon appstream data which currently
must be updated with `flatpak update --appstream`.

Closes: #1136
Approved by: mwleeds
2017-11-02 00:45:43 +00:00
Philip Withnall
3f7321292b lib/installation: Tidy up memory management in get_system_installations()
This introduces no functional changes, but makes it a bit more obvious
that we do temporarily have ownership of the FlatpakInstallation
instance.

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

Closes: #1138
Approved by: alexlarsson
2017-11-01 10:23:15 +00:00
Philip Withnall
b20818a624 lib/installation: Don’t error from flatpak_get_system_installations()
If a particular system installation is inaccessible (for example,
because it doesn’t currently exist, and we don’t have permissions to
create it), don’t error out of flatpak_get_system_installations().
Instead, do what the documentation says will happen, and ignore the
failure (emit a warning message about it).

The function continues to return an error if *no* installations could be
found.

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

Closes: #1138
Approved by: alexlarsson
2017-11-01 10:23:15 +00:00
AsciiWolf
daf65526e7 Update Czech translation
Closes: #1132
Approved by: alexlarsson
2017-10-27 10:34:33 +00:00
Alexander Larsson
2a0c17976f Update pofiles 0.10.0 2017-10-26 11:35:18 +02:00
Alexander Larsson
5b9f55e4b8 common: Unlink the old flatpak-cache symlink if we're replacing it 2017-10-26 10:55:20 +02:00
Alexander Larsson
ec8efa4e91 Fix .flatpak-cache symlink 2017-10-26 10:53:17 +02:00
Alexander Larsson
3f1ffd12cd Update version to 0.10 2017-10-26 10:17:39 +02:00
Alexander Larsson
01ffa28388 Update NEWS for release 2017-10-26 10:17:35 +02:00
Alexander Larsson
cfb34ea888 common: Make ostree bug workaround version checked
The commitstate check in parent dir was fixed in ostree 2017.13,
so we only apply the workaround for previous versions.

Closes: #1131
Approved by: alexlarsson
2017-10-26 07:43:23 +00:00
Kukuh Syafaat
e1ca3c2515 Update Indonesian translation
Closes: #1130
Approved by: mwleeds
2017-10-25 16:21:12 +00:00
Alexander Larsson
edfd6eae83 When updating from partial install, disable static deltas
The delta can contain references to files in the parent which don't
exist locally, which breaks.

Closes: #1126
Approved by: alexlarsson
2017-10-25 06:44:40 +00:00
Alexander Larsson
893c53d8e7 flatpak_dir_update: Fix leak
The return value of flatpak_deploy_data_get_subpaths needs a (shallow)
free, so put it in a separate autofree variable.

Closes: #1126
Approved by: alexlarsson
2017-10-25 06:44:40 +00:00
Alexander Larsson
a89de9dacc Use FlatpakBwrap in run/build
This is a mostly trivial conversion to use FlatpakBwrap instead
of separate argv_array/fd_array/envp variables. Anywhere it is
trivial to pass the bwrap we do, but for anything complicated
we keep the old code with separated args.

Closes: #1114
Approved by: alexlarsson
2017-10-24 08:22:07 +00:00
Alexander Larsson
1be8324d3a run: Add FlatpakBwrap
This is a wrapper around the argv, envp and fd array that
are used in the code when invoking bubblewrap. We collect them
in a single object to avoid passing a lot of arguments around.

Closes: #1114
Approved by: alexlarsson
2017-10-24 08:22:07 +00:00
Yuri Chornoivan
d62491a4f4 Update Ukrainian translation
Closes: #1125
Approved by: alexlarsson
2017-10-24 07:19:40 +00:00
Yuri Chornoivan
56d4b8a12c Update Ukrainian translation 2017-10-23 20:16:13 +03:00
Alexander Larsson
20162bb382 lib: Add api for getting and setting config options
This is primarily for setting the language atm

Closes: #1123
Approved by: alexlarsson
2017-10-20 20:06:38 +00:00
Alexander Larsson
e61071cb7b config: Move all references of "xa." prefix for config into FlatpakDir
There is no need to expose this in the API, especially the library API.

Closes: #1123
Approved by: alexlarsson
2017-10-20 20:06:38 +00:00
Alexander Larsson
b18d1c2321 Add system-helper support for configuring language.
Closes: #1123
Approved by: alexlarsson
2017-10-20 20:06:38 +00:00
Robert McQueen
d827322905 [common/flatpak-run] add /dev/mali0 to --device=dri
Apparently this also appears with different Mali versions.
Closes: #1113
Approved by: alexlarsson
2017-10-19 11:18:35 +00:00
Alexander Larsson
a4073b1a79 Fix issue with extension ld.so.conf files being empty
If regenerate_ld_cache was used then the fds involved in the
ld.so.conf files were used twice, which means they are at
the end the second time. So, we tweak the child setup to always
seek back to the start of all fds.

Closes: #1112
Approved by: alexlarsson
2017-10-18 08:01:05 +00:00
Philip Withnall
3795d5b819 common: Add missing space; improve code formatting
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1108
Approved by: alexlarsson
2017-10-17 10:22:27 +00:00
Philip Withnall
efa58b54f2 common: Remove an unnecessary conditional
fd_array is always non-NULL at this point; adding a conditional there
confuses the code, confuses static analysis, and leaves open the
possibility for ld_so_fd to be leaked if that conditional is not taken
in future.

Coverity CID: #1457790

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

Closes: #1108
Approved by: alexlarsson
2017-10-17 10:22:27 +00:00
Philip Withnall
d09a73d440 common: Add error handling around a symlink() call
Spotted by Coverity as CID #1457791.

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

Closes: #1108
Approved by: alexlarsson
2017-10-17 10:22:27 +00:00
Gunnar Andersson
98c21473fc Fix whitespace issues (remove TAB usage)
Signed-off-by: Gunnar Andersson <gandersson@genivi.org>

Closes: #1107
Approved by: mwleeds
2017-10-17 06:21:07 +00:00
Alexander Larsson
87ed5378db Add missing translation markers
As mentioned in https://github.com/flatpak/flatpak/issues/1102 we
lack translations for some strings. This fixes the ones i found in
a quick check.

Closes: #1106
Approved by: mwleeds
2017-10-16 19:03:06 +00:00
AsciiWolf
3c5f3e6d2f Update Czech translation
Closes: #1101
Approved by: mwleeds
2017-10-13 23:05:23 +00:00
Kukuh Syafaat
48ffc0fda2 Update Indonesian translation
Closes: #1100
Approved by: mwleeds
2017-10-12 17:50:22 +00:00
Piotr Drąg
33a9ccacd6 Update POTFILES.in
Closes: #1099
Approved by: mwleeds
2017-10-12 05:23:24 +00:00
Alexander Larsson
05e2afa8ce Fix up subpath handling
Whenever we add a add a local dependency we add both the languages
based on the current locale, and (in case of an update) whatever was
installed before. We also properly merge this with any normally
specified (non-dependency) update (typically happens e.g. when just
doing a "flatpak update", which adds .Locale updates both as
dependencies and regular updates).

This means you can just configure a new language and then flatpak
update will pull everything with those languages.

Closes: #1098
Approved by: alexlarsson
2017-10-11 12:48:07 +00:00
Alexander Larsson
c763295944 common: Add flatpak_subpaths_merge
This merges to subpath sets, which is useful if two sets are
specified from different sources.

Closes: #1098
Approved by: alexlarsson
2017-10-11 12:48:07 +00:00
Alexander Larsson
9e1e982bf8 Add flatpak config option
This is currenly only used to configure the languages to install.

Closes: #1098
Approved by: alexlarsson
2017-10-11 12:48:07 +00:00
Alexander Larsson
62760761b7 common: Clean up the locale detection
This is mostly a cleanup of some code and extracting common code to
helper functions. But additionally, we switch the xa.languages config
value to be a list of languages, rather than dirs, although for
backwars compat we still support if it specifies dirs.

Closes: #1098
Approved by: alexlarsson
2017-10-11 12:48:07 +00:00
Alexander Larsson
97d6e6a730 flatpakrefs: Don't g_critical if title is not set
The title is optional, so don't set it in the remote if it
is not set.

Closes: #1095
Approved by: alexlarsson
2017-10-10 12:24:18 +00:00
AsciiWolf
f776fd6839 Update Czech translation
Closes: #1094
Approved by: alexlarsson
2017-10-10 06:56:14 +00:00
Piotr Drąg
90d9a230d5 Update Polish translation
Closes: #1093
Approved by: alexlarsson
2017-10-09 15:12:41 +00:00
Alexander Larsson
e7e1331653 Make tests work on debian
The regular ldconfig is some bash wrapper over /sbin/ldconfig.real
2017-10-09 15:45:25 +02:00
Alexander Larsson
d952cdab9b update pofiles 0.9.99 2017-10-09 12:44:15 +02:00
Alexander Larsson
7f41bd7287 Update version to 0.9.99 2017-10-09 12:38:28 +02:00
Alexander Larsson
36735ece0d Update NEWS for release 2017-10-09 12:38:14 +02:00
Alexander Larsson
f0a2766551 Require OSTree 2017.12
This version has an important fix to the pull code that ensures
that all outstanding operations are settled before returning.
This is particularily important for flatpak that can do multiple
flatpak operations in different threads.

Closes: #1092
Approved by: alexlarsson
2017-10-09 10:36:55 +00:00
Alexander Larsson
f6658ad712 Use the new glnx glnx_autofd name for glnx_fd_close
This is a lot clearer

Closes: #1091
Approved by: alexlarsson
2017-10-09 10:19:00 +00:00
Colin Walters
2d32fbe0cb run: Use memfd_create() for data passed to bwrap
Followup to the previous commit to use `O_TMPFILE`, for
the cases here what we really want is to use sealed memfds.  This
ensures the container can't mutate the data we pass.

Now, the args fd I was looking at turned out to be a bwrap bug,
but this is a good example of the mitigation:

```
$ flatpak run --command="/bin/sh"  org.test.Hello
ls -al /proc/$$/fd
total 0
dr-x------. 2 1000 1000  0 Oct  1 16:43 .
dr-xr-xr-x. 9 1000 1000  0 Oct  1 16:43 ..
lrwx------. 1 1000 1000 64 Oct  1 16:43 0 -> /dev/pts/2
lrwx------. 1 1000 1000 64 Oct  1 16:43 1 -> /dev/pts/2
lrwx------. 1 1000 1000 64 Oct  1 16:43 2 -> /dev/pts/2
lrwx------. 1 1000 1000 64 Oct  1 16:43 255 -> /dev/pts/2
lrwx------. 1 1000 1000 64 Oct  1 16:43 9 -> /memfd:bwrap-args (deleted)
org.test.Hello$ echo foo > /proc/self/fd/9
sh: /proc/self/fd/9: Operation not permitted
```

Closes: #1064
Approved by: alexlarsson
2017-10-09 09:53:20 +00:00
Leo Antunes
a623d864f4 Partially revert f1df5cb to fix --persist
We should not check if a persistence target exists outside of the
chroot, since its existance is irrelevant.

Fixes #1088

Closes: #1089
Approved by: alexlarsson
2017-10-09 08:14:05 +00:00
Alexander Larsson
140fee3adf build-finish: Add --extension-priority option (#1084)
* build-finish: Add --extension-priority option

This lets you set the priority of the extension.

* fixup! build-finish: Add --extension-priority option

* fixup! build-finish: Add --extension-priority option
2017-10-06 09:01:18 -07:00
Alexander Larsson
71f7797251 Fix build: ensure we unset O_CLOEXEC on all fds
Also, we need to pass fd_array to flatpak_run_setup_base_argv so
the fds get added.
2017-10-06 14:45:01 +02:00
Alexander Larsson
898e816d17 Don't enable debug output from fuse
Fixes https://github.com/alexlarsson/xdg-document-portal/issues/29

Closes: #1083
Approved by: pwithnall
2017-10-05 21:57:45 +00:00
Colin Walters
4bc46338d9 document-portal: Handle bubblewrap changing to drop /newroot
There's an oustanding bubblewrap PR where we'd like to change how
we set up the rootfs; a side effect of this will be that /newroot
disappears from the `/proc` links:
[bubblewrap pull 172](https://github.com/projectatomic/bubblewrap/pull/172).

I took a stab here at adapting the code to work in both the old and new cases.
Just compile tested at the moment. There's a lot of subtleties in this code; in
particular how we end up mutating-in-place the path buffer and how that
interacts with inspecting it.

Closes: #1063
Approved by: alexlarsson
2017-10-05 16:54:20 +00:00
Colin Walters
0b32f63421 run: Use libglnx more (O_TMPFILE, glnx_loop_write())
In general libglnx has expanded a lot to have a good set of low-level wrappers
for things like writing a buffer to a fd.  Also, we should use `O_TMPFILE`
if available - I think the code reduction speaks for itself here.

Writing this patch as a result of looking at what fds flatpak injects.

However, *really* we want to use sealed memfds.  I'll likely copy the
systemd wrappers for that into libglnx too.

Also, it took me a while to figure out the reason the `--args` code
worked before was because we were leaking the fd.

(Updated by Alexander Larsson <alexl@redhat.com> to use O_TMPFILE
 in more places, like for the seccomp code, and rebased on
 some preparatory cleanups)

Closes: #1060
Approved by: alexlarsson
2017-10-05 16:50:11 +00:00