Commit Graph

4885 Commits

Author SHA1 Message Date
Alexander Larsson
aa978ea88a build-update-repo: Fix typo delete -> delta 2019-03-12 14:53:36 +01:00
Bastien Nocera
32c5b15326 icon-validator: Don't check SVG size
The size is just a number, but the resulting GdkPixbuf could still be
quite big compared to the amount of data we're processing, so keep
4096x4096 as maximum dimensions.

Closes: #2747
Approved by: alexlarsson
2019-03-12 13:07:41 +00:00
Bastien Nocera
8008fe38a1 icon-validator: Check image format first
Closes: #2747
Approved by: alexlarsson
2019-03-12 13:07:41 +00:00
Alexander Larsson
f3e3147d78 triggers: Use FlatpakBwrap helpers
This makes the code cleaner and more flexible for changes later.

Closes: #2755
Approved by: alexlarsson
2019-03-12 11:31:26 +00:00
Alexander Larsson
2bb84cc522 More efficient appstream generation
Rather than creating a real temp directory and
then commiting that we generate an in-memory mtree
which mostly refers to pre-existing icon file
objects, and then the newly created appdata xml.

Closes: #2753
Approved by: alexlarsson
2019-03-12 09:08:12 +00:00
Alexander Larsson
e3357bacad utils: Add some mtree helpers and rename create_root to something more correct
Closes: #2753
Approved by: alexlarsson
2019-03-12 09:08:12 +00:00
Alexander Larsson
8054dbbed1 Merge pull request #2752 from yurchor/master
Update Ukrainian translation
2019-03-12 10:05:42 +01:00
Yuri Chornoivan
6e5a00289a Update Ukrainian translation 2019-03-11 15:36:14 +02:00
Yuri Chornoivan
dba337044d Merge remote-tracking branch 'upstream/master' 2019-03-11 15:16:58 +02:00
Yuri Chornoivan
7b3ded2998 Sync Ukrainian translation with master 2019-03-11 15:15:14 +02:00
Matthew Leeds
cdb3407c59 doc/flatpak-install: Tweak examples
The gnome-apps repo is not being kept up to date so we don't want to
imply that people should use it, and make a few other tweaks to the
install command examples.

Closes: #2743
Approved by: matthiasclasen
2019-03-07 14:38:38 +00:00
Piotr Drąg
63def7a251 Update Polish translation
Closes: #2745
Approved by: matthiasclasen
2019-03-07 14:37:23 +00:00
Matthew Leeds
fece775029 Fix a leak of SoupSession
Closes: #2740
Approved by: matthiasclasen
2019-03-06 23:44:50 +00:00
Matthew Leeds
807f2baa53 Move interpretation of OSTREE_DEBUG_HTTP
It makes more sense to have this in flatpak_create_soup_session() so
every caller of that interprets the env var.

Closes: #2740
Approved by: matthiasclasen
2019-03-06 23:44:50 +00:00
Matthew Leeds
4e81789167 Consistently use flatpak_load_http_uri()
Currently Flatpak has a few different implementations of helper
functions to download a URI using libsoup, but the best one seems to be
in common/flatpak-utils-http.c. So this commit deletes the others and
makes use of flatpak_load_http_uri() in place of download_uri() in a
few places. This has a couple consequences:
1) It means that we're now properly checking HTTP status codes rather
than assuming that the request was successful, in the install command,
remote-add command, and in FlatpakTransaction. This fixes an assertion
failure seen by a user when they tried to use a flatpakref URL that hit
a 404.
2) It means that in the places where we're using flatpak_load_http_uri()
we are only supporting http:// and https:// URLs not, say, file:// ones.
For the install and remote-add commands this was already being enforced.
For the handling of flatpakref files and bundles in FlatpakTransaction,
I believe it's just convention because it doesn't make much sense to
do anything else; this commit enforces that convention.

Also, add a unit test for the case of trying to install a flatpakref at
a URL that hits a 404 error.

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

Closes: #2740
Approved by: matthiasclasen
2019-03-06 23:44:50 +00:00
Matthew Leeds
7a5c024695 dir: Fix GError handling in flatpak_load_deploy_data()
Commit b20ee7e26 introduced a bug where flatpak_load_deploy_data()
returns NULL without setting @error in the case that there's a problem
reading the deploy file. I think this is causing a seg fault in
flatpak_installation_list_installed_refs() which tries to print the
error message after calling get_ref() (which indirectly loads the deploy
file).

I didn't personally verify that this fixes the GNOME Builder seg fault
that was reported, but it seems almost certain looking at the provided
stack trace, since get_ref() only returns NULL if
flatpak_dir_get_deploy_data() returns NULL, and that function clearly
sets the error pointer on failure except in flatpak_load_deploy_data().

I'm not sure why the deploy file doesn't exist (or is unreadable) for
the user who reported this seg fault.

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

Closes: #2733
Approved by: matthiasclasen
2019-03-04 17:38:10 +00:00
Kukuh Syafaat
ac13101007 Update Indonesian translation
Closes: #2734
Approved by: mwleeds
2019-02-28 15:44:03 +00:00
scootergrisen
50920ba466 Add Danish translation
Closes: #2731
Approved by: matthiasclasen
2019-02-27 22:11:15 +00:00
Alexander Larsson
26b6bb4990 build-update-repo: Add --no-update-[summary,appstream]
We'd like to use these in flat-manager for more detailed updates
of the repo.

Closes: #2730
Approved by: alexlarsson
2019-02-27 11:20:58 +00:00
AsciiWolf
cc4090f1c9 Update Czech translation
Closes: #2728
Approved by: matthiasclasen
2019-02-26 15:16:40 +00:00
AsciiWolf
75690a08bb Fix missing translatable string
Closes: #2724
Approved by: mwleeds
2019-02-25 22:10:10 +00:00
Matthew Leeds
e8816b7663 Remove extra newlines in variable definiton blocks
Uncrustify has an option "nl_func_var_def_blk" which is supposed to
ensure there's a newline character between the block of variable
definitions and the rest of the function body, but it gets confused and
thinks that the first instance of "g_autoptr" or "g_auto" being used on
a variable is the start of the function body. So this commit removes
those extra newline characters and removes that option in uncrustify.cfg
so they don't get re-added the next time uncrustify is run.

Here's the command I used:

perl -0777 -i -pe 's/\n(\n\s*g_auto\()/\1/g' `git ls-tree --name-only
-r HEAD | grep \\\.[ch]$ | grep -v common/valgrind-private.h |
grep -v app/flatpak-polkit-agent-text-listener\\\.[ch]`

I ran it again with "g_autoptr" in place of "g_auto", and made a few
manual edits to add back the newline when the g_auto* was in the middle
of a function body rather than at the top.

Closes: #2715
Approved by: matthiasclasen
2019-02-25 18:12:30 +00:00
Matthew Leeds
a0d3d65476 Remove extra newlines near curly braces
Edit uncrustify.cfg to add options to remove extra newlines near opening
and closing braces, and run uncrustify again.

Closes: #2715
Approved by: matthiasclasen
2019-02-25 18:12:30 +00:00
Matthew Leeds
8d962a686f Run uncrustify
I had to make a few manual edits but other than those the changes look
reasonable.

Closes: #2715
Approved by: matthiasclasen
2019-02-25 18:12:30 +00:00
Matthew Leeds
7d72dd713f uncrustify: Exclude app/flatpak-polkit-agent-text-listener.[ch]
These are copied from polkit so we don't want to uncrustify them.

Closes: #2715
Approved by: matthiasclasen
2019-02-25 18:12:30 +00:00
Matthias Clasen
4c5c359c91 Convert dconf settings to keyfile
We do a one-time conversion of existing dconf user settings
into a keyfile in the apps XDG_CONFIG_DIR, where the glib
keyfile settingsbackend will look for it.

Closes: #2678
Approved by: alexlarsson
2019-02-21 01:09:58 +00:00
Matthias Clasen
9e25dfabcd dconf: Prepare for reading user values
Pass the DCONF_READ flags down, so we can use a different one.

Closes: #2678
Approved by: alexlarsson
2019-02-21 01:09:58 +00:00
Alexander Larsson
28e96288c4 Fix issues with XDG_RUNTIME_DIR being /var/run which is a symlink
Whenever we use $XDG_RUNTIME_DIR and expose it somehow in the sandbox
we fully resolve the path, because if (as happens on gentoo for instance)
it contains /var/run -> ../run, then flatpak thinks we need to
add the /var/run symlink in the runtime even though we already
exposed that.

Closes: #2710
Approved by: matthiasclasen
2019-02-20 19:43:28 +00:00
Kukuh Syafaat
13e449b503 Update Indonesian translation
Closes: #2709
Approved by: matthiasclasen
2019-02-18 15:20:14 +00:00
Matthew Leeds
368f7ae0b1 .gitignore: Ignore tags file
This is generated by the "ctags" command.
2019-02-15 15:42:00 -08:00
Matthew Leeds
182706b938 installation: Remove no longer needed ostree version checks
Flatpak depends on ostree 2018.9, so there's no need for these checks
any more.

Closes: #2704
Approved by: alexlarsson
2019-02-14 10:20:23 +00:00
Matthias Clasen
ce0981cb6d table printer: Use cell width, throughout
This should make it safe to use Escape sequences
in table content without messing up the alignment.

Closes: #2689
Approved by: alexlarsson
2019-02-14 09:12:40 +00:00
Matthias Clasen
71b5b66da6 Add utilities for 'cell width'
These functions are like g_utf8_strlen and g_utf8_offset_to_pointer,
but know to skip the Escape sequences we use.

Closes: #2689
Approved by: alexlarsson
2019-02-14 09:12:40 +00:00
Matthias Clasen
e9382b34bd cli transaction: Make the checks green
Success ought to be green.

Related: #2671

Closes: #2676
Approved by: mwleeds

Closes: #2689
Approved by: alexlarsson
2019-02-14 09:12:40 +00:00
Patrick Griffis
d2dff2875b Support multiple nvidia cards
Closes: #2695
Approved by: alexlarsson
2019-02-14 08:48:47 +00:00
Matthew Leeds
4607739677 Delete stray semicolons
Closes: #2703
Approved by: matthiasclasen
2019-02-14 06:14:59 +00:00
Piotr Drąg
5c19c3242d Update Polish translation
Closes: #2700
Approved by: matthiasclasen
2019-02-13 14:11:07 +00:00
AsciiWolf
4fe2d19ed2 Update Czech translation
Closes: #2697
Approved by: matthiasclasen
2019-02-12 01:41:33 +00:00
Alexander Larsson
cd2142888f Don't expose /proc when running apply_extra
As shown by CVE-2019-5736, it is sometimes possible for the sandbox
app to access outside files using /proc/self/exe. This is not
typically an issue for flatpak as the sandbox runs as the user which
has no permissions to e.g. modify the host files.

However, when installing apps using extra-data into the system repo
we *do* actually run a sandbox as root. So, in this case we disable mounting
/proc in the sandbox, which will neuter attacks like this.
2019-02-11 14:36:41 +01:00
Matthew Leeds
b85f386a6b .gitignore: Add missing files
Closes: #2691
Approved by: matthiasclasen
2019-02-11 12:47:06 +00:00
Matthew Leeds
61f44231fe Unstable version should be 1.3.0 not 1.3.1
1.3.0 hasn't been released, so that should be the next unstable version.

Closes: #2688
Approved by: matthiasclasen
2019-02-08 15:50:10 +00:00
Alexander Larsson
7c9368d100 CLI: Handle consoles reporting zero size
For whatever reason, in the buildbot environment the TIOCGWINSZ
ioctl returns a 0x0 size, which causes a divide by zero. We
handle this by returning a default 80x24 size.

Closes: #2685
Approved by: alexlarsson
2019-02-06 09:31:45 +00:00
Alexander Larsson
2ea428a541 Revert "cli transaction: Make the checks green"
This reverts commit e209ac9e10.

We're counting thee escape sequences as width, until we fix
this we disable this.

Closes: #2686
Approved by: alexlarsson
2019-02-06 09:17:49 +00:00
Alexander Larsson
24398ad1c2 Change version to 1.3.1, do stable work on flatpak-1.2.x branch 2019-02-05 14:19:00 +01:00
Alexander Larsson
7b78a7d0af Update pofiles 1.2.1 2019-02-05 14:00:02 +01:00
Alexander Larsson
101f8bd8e6 Update NEWS for release 2019-02-05 12:57:31 +01:00
Alexander Larsson
06a2f4d82d Actually always return non-null from flatpak_dir_get_display_name()
This also changes this to a non-const as we need to generate it.

Closes: #2683
Approved by: alexlarsson
2019-02-05 11:45:54 +00:00
Alexander Larsson
8928a60876 Bump version to 1.2.1 2019-02-05 11:35:49 +01:00
Matthias Clasen
f8dfcf66f8 Only install polkit agent when needed
We don't need a polkit agent for simple things like
flatpak --installations. Only install it for running
actual commands.

Closes: #2679
Approved by: alexlarsson
2019-02-05 10:35:26 +00:00
Matthias Clasen
2bf420b93a icon validator: Use exec for the sandboxing
We don't really need a separate process here, and
doing things this way makes output from the sandbox
appear outside, thereby giving us meaningful error
messages for invalid icons.

Related: #2669

Closes: #2677
Approved by: alexlarsson
2019-02-05 10:00:15 +00:00