18190 Commits

Author SHA1 Message Date
Aurimas Černius
25f32b3352 Updated Lithuanian translation 2018-10-07 16:37:24 +03:00
Philip Withnall
c5b577fbf5 2.56.3
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2.56.3
2018-09-21 10:41:56 +01:00
Matej Urbančič
e8756552e9 Updated Slovenian translation 2018-09-17 21:16:43 +02:00
Kukuh Syafaat
6f49a2f2af Update Indonesian translation 2018-09-14 13:06:07 +00:00
Balázs Úr
3fb0950701 Update Hungarian translation 2018-09-13 22:01:06 +00:00
Iain Lane
1516e47181 Merge branch 'glib-2-56-313-network-monitor-netlink-fixes' into 'glib-2-56'
Backport GNetworkMonitorNetlink fixes from !313 to glib-2-56

See merge request GNOME/glib!325
2018-09-13 14:14:50 +00:00
Iain Lane
38482ead59 gnetworkmonitornetlink: Close the socket after disconnecting its GSources
`read_netlink_messages()` is the callback attached to the netlink socket
(G_IO_IN). It calls `g_socket_receive_message()`. There is a race
condition that if the socket is closed while there is a pending call, we
will try to receive on a closed socket, which fails.

To avoid this, we switch the order of the operations around: first
destroy the source and then close the socket.
2018-09-13 14:11:30 +01:00
Iain Lane
2cc2663434 gnetworkmonitornetlink: Don't check if a passed-in GError ** is NULL
This is not a correct way to check if `g_socket_new_from_fd()` failed.
Instead just see if it returned `NULL` itself.

This was preventing the netlink monitor from being initialised.

Closes #1518
2018-09-13 14:11:30 +01:00
Marek Cernocky
96e8e03a57 Updated Czech translation 2018-09-13 13:59:24 +02:00
Rafael Fontenelle
27d3e353ce Update Brazilian Portuguese translation 2018-09-08 02:10:33 +00:00
Anders Jonsson
084282328d Update Swedish translation 2018-09-07 20:59:27 +00:00
Tim Sabsch
a1dfad90d1 Update German translation 2018-09-07 17:57:15 +00:00
Piotr Drąg
6bcc1e4bcb Update Polish translation 2018-09-07 19:04:23 +02:00
Philip Withnall
d188851253 Merge branch 'markup-cve-fixes-2-56' into 'glib-2-56'
Backport gmarkup fixes to 2.56

See merge request GNOME/glib!307
2018-09-07 11:34:19 +00:00
Philip Withnall
c008d2c436 gmarkup: Fix crash in error handling path for closing elements
If something which looks like a closing tag is left unfinished, but
isn’t paired to an opening tag in the document, the error handling code
would do a null pointer dereference. Avoid that, at the cost of
introducing a new translatable error message.

Includes a test case, courtesy of pdknsk.

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

https://gitlab.gnome.org/GNOME/glib/issues/1461
(cherry picked from commit fccef3cc822af74699cca84cd202719ae61ca3b9)
2018-09-06 17:56:21 +01:00
Philip Withnall
6ea19a71e8 gmarkup: Fix unvalidated UTF-8 read in markup parsing error paths
When formatting the error messages for markup parsing errors, the parser
was unconditionally reading a UTF-8 character from the input buffer —
but the buffer might end with a partial code sequence, resulting in
reading off the end of the buffer by up to three bytes.

Fix this and add a test case, courtesy of pdknsk.

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

https://gitlab.gnome.org/GNOME/glib/issues/1462
(cherry picked from commit cec71705406f0b2790422f0c1aa0ff3b4b464b1b)
2018-09-06 17:56:21 +01:00
Philip Withnall
5716eeacaf Merge branch '266-subprocess-communicate-glib-2-56' into 'glib-2-56'
Backport g_subprocess_communicate() cancellation fixes from !266 to glib-2-56

See merge request GNOME/glib!278
2018-08-30 12:35:13 +00:00
Marco Trevisan (Treviño)
cb63affd8d tests, subprocess: units for cancelled communications 2018-08-30 13:25:35 +01:00
Marco Trevisan (Treviño)
80a2648953 subprocess: Fix communicate_cancelled signature
The source callback for a GCancellable should have the cancellable itself
as first argument.
This was not the case, and when this code was hit, we were instead trying
to treat the pointer as a CommunicateState reference and thus wrongly
deferencing it, causing a memory error and a crash.
2018-08-30 13:25:35 +01:00
Simon McVittie
8ca9c2e350 Merge branch '1465-g-gnuc-malloc-on-glib-2-56' into 'glib-2-56'
Backport G_GNUC_MALLOC fixes from #1465 to glib-2-56

See merge request GNOME/glib!261
2018-08-23 09:21:10 +00:00
Philip Withnall
c582b947cb Merge branch 'test-ip_mreq_source-android-only-2-56' into 'glib-2-56'
build: only test for broken ip_mreq_source on Android. Fixes #1472

See merge request GNOME/glib!249
2018-08-22 16:22:43 +00:00
Christoph Reiter
966b3d80e9 build: only test for broken ip_mreq_source on Android. Fixes #1472
7efd76dd6796f8 added these configure time tests to work around a bug
with older Android. Since the test didn't take Windows into account it
wrongfully applied the workaround on Windows too, breaking the build.
With meson this wasn't an issue since the check is skipped on Windows there
and our CI didn't catch this issue.

Change the test to run on Android only for meson and autotools.
This also makes it clear that the test+code can be dropped again if we stop
supporting older Android versions at some point.
2018-08-22 18:08:46 +02:00
Philip Withnall
0e10479f85 glib: Drop G_GNUC_MALLOC usage from various other allocation functions
These functions may be OK to leave the G_GNUC_MALLOC attribute on,
because the only valid pointers in the storage areas they return are,
themselves, new pointers.

However, it’s a lot easier to remove the attributes now than to try and
diagnose miscompilations in future. The performance impact of this is
likely to be unmeasurable. If there are performance problems caused by
this, then they can be profiled and fixed case-by-case in future,
bearing in mind the possibility for miscompilation if G_GNUC_MALLOC is
readded.

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

https://gitlab.gnome.org/GNOME/glib/issues/1465
2018-08-22 14:12:18 +01:00
Philip Withnall
41f23a2c44 glib: Drop G_GNUC_MALLOC usage from various allocation functions
These are our most critically incorrect uses of G_GNUC_MALLOC. See the
previous commit for details.

(Backport to 2.56: Drop the grcbox.h changes.)

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

https://gitlab.gnome.org/GNOME/glib/issues/1465
2018-08-22 14:12:18 +01:00
Philip Withnall
3d6c8e037d docs: Update the documentation for G_GNUC_MALLOC to reflect recent GCC
Thanks to some great investigation by Benjamin Moody, it’s clear that
our documentation and usage of G_GNUC_MALLOC has fallen behind GCC’s
interpretation of the malloc attribute, meaning that recent versions of
GCC could miscompile code which uses G_GNUC_MALLOC incorrectly.

Update the documentation of G_GNUC_MALLOC to match the current GCC
documentation (for GCC 8.2). Following commits will drop our use of
G_GNUC_MALLOC from inappropriate functions.

Specifically, the change in GCC’s interpretation of the malloc attribute
which could cause miscompilation is that returned storage areas are now
assumed to not contain valid pointers — so realloc() cannot have the
malloc attribute, and neither can a function which returns a newly
allocated structure with fields initialised to other pointers.

(Backport to 2.56: Change the documentation to mention GLib 2.56.3
rather than GLib 2.58.)

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

https://gitlab.gnome.org/GNOME/glib/issues/1465
2018-08-22 14:12:02 +01:00
Emmanuele Bassi
d8a496bdb4 Merge branch 'glib-2-56-ci-failure' into 'glib-2-56'
Fix persistent CI failure on glib-2-56

See merge request GNOME/glib!259
2018-08-22 11:11:05 +00:00
Philip Withnall
1eb52b6ea1 tests: Increase timeout for network-monitor-race test
It’s consistently timing out on the CI, which makes sense since it does
333 iterations of spawning a subprocess. Give it a bit more breathing
room.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-22 11:22:02 +01:00
Matthias Clasen
d4b60396c7 2.56.2 2.56.2 2018-08-16 20:24:55 -04:00
Matthias Clasen
d0f6a59fb0 network monitor portal: update properties initially
With version 2, we need to query the values explicitly.
The properties made this automatic.
2018-08-17 00:03:32 +00:00
Matthias Clasen
7ddd1de0dd network monitor: Update portal implementation
The network monitor portal interface is changing.
Version 2 is no longer using properties, but getters
instead (this lets the portal apply access control
and avoid sending information to non-networked
sandboxes).

To support both version 1 and 2 of the interface,
we stop using generated code and instead deal with
the api differences in our own code, which is not
too difficult.

Support version 1 as well
2018-08-16 16:54:14 -04:00
Milan Crha
edcce31f8e gnetworkmonitor: Fix use-after-free when using from another thread
When using g_network_monitor_get_default() from another thread, it’s
possible for network-changed events to be processed after an instance of
GNetworkMonitor has been disposed, causing use-after-free problems.

Fix that by moving some of the initialisation into the GInitable.init()
chain, rather than in a main context idle callback.

This includes a unit test which probabilistically reproduces the bug
(but can’t do so deterministically due to it being a race condition).

Commit amended by Philip Withnall <withnall@endlessm.com> before
pushing.

https://bugzilla.gnome.org/show_bug.cgi?id=793727
2018-08-16 16:53:53 -04:00
Ondrej Holy
0b4e821763 Merge branch 'cherry-pick-volume-mount-2-56' into 'glib-2-56'
Cherry pick GVolumeMonitor mount changes to glib-2-56 from issue #1458

See merge request GNOME/glib!224
2018-08-09 14:50:51 +00:00
Philip Withnall
d338fdaf75 Merge branch '1452-backport-glib-2-56' into 'glib-2-56'
Backport GFileInfo win32 fixes to glib-2-56

See merge request GNOME/glib!237
2018-08-09 10:12:46 +00:00
Руслан Ижбулатов
7fa2ad51a8 W32: consider NTFS mounpoints to be symlinks
While mountpoints are *not* symlinks, strictly speaking,
they works in a similar enough way, so consider them to be
symlinks for the purpose of querying local file info.
2018-08-09 10:30:37 +01:00
Руслан Ижбулатов
9f56652cea W32: correctly use st_ctime
On Windows st_ctime field is the file creation time.
POSIX mandates that field to be the file state change time.
Naturally, glib code interpreted st_ctime as POSIX suggested,
and the result was bad.
Fix this by introducing special W32-only logic for setting
attributes from st_ctime field.

Fixes issue #1452.
2018-08-09 10:30:37 +01:00
Ondrej Holy
2c1aee1963 gio-tool: Hold GVolumeMonitor reference during operations
Releasing GVolumeMonitor before g_volume_mount finish cause that
g_volume_get_mount returns NULL, because the mount is not correctly
propagated to the volume.

(Backported from commit 88b8ebb5dde0512fd1e098efe4c217111876d252 with
minor merge conflicts.)

https://gitlab.gnome.org/GNOME/glib/issues/1458
2018-08-03 11:53:09 +01:00
Ondrej Holy
f9ab355896 gio: Update mounts after g_volume_mount
The documentation claims that g_volume_get_mount should	succeed	after
g_volume_mount. Let's update mounts before releasing g_volume_mount to
be sure that the mount is added to the corresponding volume. The same
is done in GVfsUDisks2VolumeMonitor.

(Backported from commit 9b6b282e0a9d3f37865aa36e21ea57bd2a326e20 with no
merge conflicts.)

https://gitlab.gnome.org/GNOME/glib/issues/1458
2018-08-03 11:53:09 +01:00
Ondrej Holy
86b5b440a8 Merge branch 'cifs-is-not-a-system-fs' into 'master'
gunixmounts: Stop considering cifs/nfs as system file systems

See merge request GNOME/glib!125

(cherry picked from commit 51132b1d49c184f49baafa81ce7fac02b1458643)

a3a6c516 gunixmounts: Stop considering cifs/nfs as system file systems
2018-06-29 07:11:54 +00:00
Philip Withnall
baeaca4f31 Merge branch '1280-fdo-notification-glib-2-56' into 'glib-2-56'
Backport "fdo notification backend: Crashes when dbus call fails" to glib-2-56

See merge request GNOME/glib!102
2018-06-13 14:28:15 +00:00
Arnaud Rebillout
d26b66e225 gfdonotificationbackend: Fix possible invalid pointer in dbus callback
The way things were before: a FreedesktopNotification struct is
allocated before the dbus call, and this same struct is possibly re-used
for other dbus calls. If the server becomes unavailable, the callback
will be invoked after the call times out, which leaves a long time where
other dbus calls can happen, re-using the same FreedesktopNotification
as user data. When the first call times out, the callback is invoked,
and the user data is freed. Subsequent calls that used the same user
data will time out later on, and try to free a pointer that was already
freed, hence segfaults.

This bug can be reproduced in Cinnamon 3.6.7, as mentioned in:
<https://github.com/linuxmint/Cinnamon/issues/7491>

This commit fixes that by always allocating a new
FreedesktopNotification before invoking dbus_call(), ensuring that the
callback always have a valid user data.

Signed-off-by: Arnaud Rebillout <elboulangero@gmail.com>
2018-06-13 14:08:50 +01:00
Philip Withnall
4a27a88d29 ci: Use v3 of the Docker image for CI builds
Don’t update to the full CI setup from master, since its success depends
on other fixes which are only present in master. However, using v1 of
the Docker image is no longer possible since it’s been removed from the
registry. Using v3 should enable CI builds for glib-2-56 to succeed.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-06-13 14:07:18 +01:00
Philip Withnall
826676e826 Merge branch '101-dbus-is-supported-glib-2-56' into 'glib-2-56'
Backport "g_dbus_is_supported_address(): set error if returning FALSE" to glib-2-56

See merge request GNOME/glib!103
2018-06-13 12:38:05 +00:00
Will Thompson
aaa00b5c98 g_dbus_is_supported_address(): set error if returning FALSE
Previously, calling:

    g_dbus_is_supported_address ("some-imaginary-transport:", NULL)

correctly returned FALSE; but calling:

    g_dbus_is_supported_address ("some-imaginary-transport:", &error)

crashed with:

    GLib-GIO:ERROR:../gio/gdbusaddress.c:434:g_dbus_is_supported_address:
    assertion failed: (ret || (!ret && (error == NULL || *error != NULL)))

This was because, if the address component did not start with a known
transport, no error was set. Fix this, reusing an error string used by
the corresponding else branch in g_dbus_address_connect(), and adjust
the test to pass both NULL and non-NULL GError **s to this function in
every test case. This case:

    g_assert (!g_dbus_is_supported_address ("some-imaginary-transport:foo=bar;unix:path=/this/is/valid", NULL));

would have caught this bug with a non-NULL GError **.
2018-06-13 13:35:35 +01:00
Xavier Claessens
c0e6cc3a40 Merge branch 'cherry-pick-95ebaa26' into 'glib-2-56'
Merge branch '1401-g_clear_handle_id-clear_func-not-nullable' into 'master'

See merge request GNOME/glib!56
2018-06-05 14:43:36 +00:00
Philip Withnall
cfa28e152b Merge branch '1401-g_clear_handle_id-clear_func-not-nullable' into 'master'
g_clear_handle_id: don't accept NULL clear_func

Closes #1401

See merge request GNOME/glib!55

(cherry picked from commit 95ebaa26aa5b2a5f6e5ee554a6d185d296f6dc08)

0f7c196c g_clear_handle_id: don't accept NULL clear_func
2018-06-04 13:43:21 +00:00
Philip Withnall
69dec2db49 Merge branch 'lrn/issue-1240_glib-2-56' into 'glib-2-56'
W32: Make _g_win32_get_system_data_dirs() inline available in C++ (glib-2-56 backport)

See merge request GNOME/glib!29
2018-05-28 08:58:46 +00:00
Руслан Ижбулатов
d5f1da8c39 W32: Make _g_win32_get_system_data_dirs() inline available in C++
This way g_get_system_data_dirs() works the same way in C and C++.

https://bugzilla.gnome.org/show_bug.cgi?id=777501

Closes #1240
2018-05-28 08:48:06 +00:00
Руслан Ижбулатов
0bc1e98af6 W32: check filename for being NULL in g_stat()
Previous version of this function started with a call to g_utf8_to_utf16(),
which also served as a NULL check, since g_utf8_to_utf16() just returns NULL
on NULL strings. Current version of this function does some filename string
checks first and converts it to utf16 only after these checks are done, and
these checks do not take into account the possibility of filename being NULL.

Fix this by explicitly checking for NULL.
2018-05-22 16:47:34 +00:00
Nirbheek Chauhan
4c364635ed meson: Update glib version 2018-05-05 03:19:54 +05:30
Philip Withnall
0489f609ca gobject: Reimplement g_param_values_cmp() for GParamSpecVariant
The existing implementation was completely incorrect (despite the fix in
commit 566e64a66) — it always compared GVariants by pointer, rather than
by value.

Reimplement it to compare them by value where possible, depending on
their type. The core of this implementation is g_variant_compare(). See
the documentation and tests for further details of the new sort order.

This adds documentation and tests.

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

https://bugzilla.gnome.org/show_bug.cgi?id=795735
2018-05-04 18:20:22 +01:00