19958 Commits

Author SHA1 Message Date
Emmanuele Bassi
de4d107744 Merge branch 'backport-945-markup-stack-overrun-glib-2-60' into 'glib-2-60'
Backport !945 “Avoid overrunning stack at the end of the varargs.” to glib-2-60

See merge request GNOME/glib!949
2019-07-09 10:42:08 +00:00
Emmanuele Bassi
1431ff0717 Merge branch 'backport-954-unicode-mani-glib-2-60' into 'glib-2-60'
Backport !954 “Fix the ISO 15924 code for Manichaean” to glib-2-60

See merge request GNOME/glib!956
2019-07-09 10:41:31 +00:00
Emmanuele Bassi
74a6c12742 Merge branch 'backport-974-keyfile-settings-type-glib-2-60' into 'glib-2-60'
Backport !974 “Ensure that the keyfile settings backend exists” to glib-2-60

See merge request GNOME/glib!977
2019-07-09 10:39:51 +00:00
Matthias Clasen
cba4a0d2df Ensure that the keyfile settings backend exists
We need to bring the type into existence.

Closes: https://gitlab.gnome.org/GNOME/glib/issues/1822
2019-07-09 09:50:11 +01:00
Emmanuele Bassi
e43a63726d Merge branch 'backport-968-openuriportal-typo-glib-2-60' into 'glib-2-60'
Backport !968 ”Fix typo in request handle” to glib-2-60

See merge request GNOME/glib!969
2019-07-04 16:58:40 +00:00
David Strauss
dcfb232b3e Fix typo in request handle 2019-07-04 17:24:41 +01:00
David Corbett
4fe42771ec Fix the ISO 15924 code for Manichaean 2019-06-27 11:14:40 +01:00
John Ralls
353942c67e Avoid overrunning stack at the end of the varargs. 2019-06-24 14:28:54 +01:00
Philip Withnall
23a6173e4e Merge branch 'dbus-security-glib-2-60' into 'glib-2-60'
Backport !909 “D-Bus auth mechanism improvements” to glib-2-60

See merge request GNOME/glib!910
2019-06-11 10:21:46 +00:00
Simon McVittie
85c1ec0827 gdbusdaemon: Only authorize anonymous users on Windows, not Unix
On Unix, we expect EXTERNAL authentication to work.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-06-11 11:06:47 +01:00
Simon McVittie
d2ae55fafa gdbus-example-peer: Provide an example GDBusAuthObserver
It's somewhat unrealistic to use a GDBusServer without a
GDBusAuthObserver, because most D-Bus servers want to be like the
standard session bus (the owning user can connect) rather than being
like the standard system bus (all users can connect, the server is a
security boundary, and many bugs are security vulnerabilities).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-06-11 11:06:47 +01:00
Simon McVittie
27e4e387cc GDBusAuthObserver: Document how to restrict authentication to EXTERNAL
This is simpler and more robust than DBUS_COOKIE_SHA1, which relies
on assumptions about random numbers and a secure home directory.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-06-11 11:06:47 +01:00
Simon McVittie
6964a2a255 GDBusAuthObserver: Fix mixup between authentication and authorization
Authentication is about proving who I am; authorization is about
whether, given the knowledge of who I am, I am allowed to do something.
GDBusServer and GDBusConnection carry out authentication automatically,
but rely on the library user to carry out authorization.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-06-11 11:06:47 +01:00
Simon McVittie
1031e466cf GDBusServer: Document that a GDBusAuthObserver is usually desirable
Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-06-11 11:06:47 +01:00
Simon McVittie
b6988b685f Document where we expect credentials-passing to be supported
This is useful information for implementors of portable software to know
whether they can rely on credentials-passing.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-06-11 11:06:47 +01:00
Philip Withnall
6672d0cbed 2.60.4
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2.60.4
2019-06-10 18:37:19 +01:00
Emmanuele Bassi
e25de8e5d5 Merge branch 'backport-904-genmarshal-fixes-glib-2-60' into 'glib-2-60'
Backport !904 “Fix some valist genmarshal bugs” to glib-2-60

See merge request GNOME/glib!905
2019-06-10 17:03:42 +00:00
Sebastian Dröge
acdccff4d2 Merge branch 'backport-799-func-macro-glib-2-60' into 'glib-2-60'
Backport !799 “Revert "macros: Try to use the standard __func__ first in G_STRFUNC"” to glib-2-60

See merge request GNOME/glib!899
2019-06-10 12:15:55 +00:00
Philip Withnall
804ce8b703 glib-genmarshal: Avoid a string copy for static string valist arguments
When building a valist marshaller, we can avoid a string copy if the
argument is known to always be static. The marshaller we ship in
`gmarshal.c` got this right, but marshallers generated by
glib-genmarshal were missing the optimisation. Fix that.

Backported version of !904 does not include the unit test. The version
of this on `master` includes a unit test.

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

Fixes: #1792
2019-06-08 00:30:24 +01:00
Philip Withnall
f843ba8c44 glib-genmarshal: Fix ref-sinking of GVariants in valist marshallers
The old (Perl) implementation of glib-genmarshal used
g_variant_ref_sink() to correctly handle floating inputs; the Python
version should do the same.

Backported version of !904 does not include the unit test. The version
of this on `master` includes a unit test.

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

Fixes: #1793
2019-06-08 00:30:20 +01:00
Philip Withnall
7f7f7e3cc3 Revert "macros: Try to use the standard __func__ first in G_STRFUNC"
This reverts commit 9f75cc9edf1d311ef4bacc3d686c7afa0c4dcbb2.

It breaks usage of G_STRFUNC when compiling applications with
`-Wpedantic` — `__func__` is not `#define`d, so G_STRFUNC was falling
through to using `__FUNCTION__`, which raises a warning with
`-Wpedantic`.

Fun times.

Fixes: #1755
2019-06-07 11:14:07 +01:00
Philip Withnall
dbd8193a87 Merge branch 'backport-865-happier-eyeballs-glib-2-60' into 'glib-2-60'
Backport !865 'gnetworkaddress: fix "happy eyeballs" logic' to glib-2-60

See merge request GNOME/glib!894
2019-06-05 09:45:40 +00:00
Allison Karlitskaya
24c2760c8f network-address test: add ipv6-fail ipv4-slow case
Add a case for when the IPv6 result comes back negative and the IPv4
result is significantly delayed.  This is exactly the case that causes
the bug addressed by GNOME/glib!865
2019-06-05 09:34:37 +02:00
Allison Karlitskaya
2b6a3c110d gnetworkaddress: fix "happy eyeballs" logic
The "happy eyeballs" RFC states that on receiving a negative response
for an IPv6 address lookup, we should wait for the IPv4 lookup to
complete and use any results we get from there.

The current code was not doing that: it was rather setting a timeout for
failing the resolution entirely.  In scenarios where the IPv4 response
comes more than 50ms after the IPv6 response (which is easily attainable
under valgrind in certain configurations) this means that the IPv4
response will never come.

Remove the timeout and just wait.

See merge request GNOME/glib!865
2019-06-04 23:01:37 +02:00
Philip Withnall
39cbb84e36 Merge branch 'backport-876-gfile-permissions-glib-2-60' into 'glib-2-60'
Backport !876 “gfile: Limit access to files when copying” to glib-2-60

See merge request GNOME/glib!878
2019-06-04 10:09:16 +00:00
Ondrej Holy
e6b769819d gfile: Limit access to files when copying
file_copy_fallback creates new files with default permissions and
set the correct permissions after the operation is finished. This
might cause that the files can be accessible by more users during
the operation than expected. Use G_FILE_CREATE_PRIVATE for the new
files to limit access to those files.
2019-06-04 10:58:20 +01:00
Christoph Reiter
e4ae836d40 Merge branch 'backport-875-ci-win32-glib-2-60' into 'glib-2-60'
Backport !875 “CI/msys2: disable coverage reporting, lcov doesn't support gcc9 yet” to glib-2-60

See merge request GNOME/glib!886
2019-06-04 05:48:40 +00:00
Christoph Reiter
97376f95bf CI/msys2: disable coverage reporting, lcov doesn't support gcc9 yet
(Backport: Fix minor cherry-pick conflicts.)

https://github.com/linux-test-project/lcov/issues/58

Fixes: #1795
2019-06-03 12:06:35 +01:00
Philip Withnall
1dfef5df6a gnetworkmonitornm: Consider NM_STATE_CONNECTED_SITE to be available
`NM_STATE_CONNECTED_SITE` is documented to mean that a default route is
available, but that the internet connectivity check failed. A default
route being available is compatible with the documentation for
GNetworkMonitor:network-available, which should be true if the system
has a default route for at least one of IPv4 and IPv6.

https://developer.gnome.org/NetworkManager/stable/nm-dbus-types.html

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

Fixes: #1788


(cherry picked from commit e37f0cbd8914f16d509809a46977e6d32cf72a6e)
2019-05-31 14:45:34 +00:00
Philip Withnall
0f6191d02a Version 2.60.3
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2.60.3
2019-05-21 16:58:44 +01:00
Philip Withnall
b3e1a380d3 Merge branch 'backport-852-gdb-hash-tables-glib-2-60' into 'glib-2-60'
Backport !852 “Update gdb pretty-printer for GHashTable” to glib-2-60

See merge request GNOME/glib!858
2019-05-21 15:52:02 +00:00
zb3
44dbe80e5c Update gdb pretty-printer for GHashTable
Fixes #1780
2019-05-21 12:20:35 +01:00
Emmanuele Bassi
4477ae63ea Merge branch 'backport-848-hash-table-again-glib-2-60' into 'glib-2-60'
Backport !848 (more GHashTable fixes) to glib-2-60

See merge request GNOME/glib!855
2019-05-21 10:29:36 +00:00
Allison Karlitskaya
3bed8a13bc ghash: fix small array handling in g_hash_table_remove_all_nodes()
Factor out the code for setting up the hash table size, mask and mod,
detecting valgrind and allocating the arrays for hashes, keys, and
values.

Make use of this new function from g_hash_table_remove_all_nodes().

The handling of have_big_keys and have_big_values was never correct in
this function because it reallocated the array without changing the
flags in the struct.  Any calls in to the hashtable from destroy
notifies would find the table in an inconsistent state.

Many thanks to Thomas Haller who is essentially responsible for all the
real work in this patch: both discovering and identifying the original
problem, as well as finding the solution to it.
2019-05-20 16:55:45 +01:00
Allison Karlitskaya
2b13c3f797 ghash: Be more explicit about memory in g_hash_table_destroy_all_nodes()
Make it clear that there is a reference transfer going on here, rather
than relying on the fields being overwritten on each branch of the
conditional below.
2019-05-20 16:55:45 +01:00
Allison Karlitskaya
bef8b10c96 ghash: do less work when destroying the table
We were calling g_hash_table_set_shift() to reinitialise the hash table
even in the case of destroying it.  Only do that for the non-destruction
case, and fill the relevant fields with zeros for the destruction case.
This has a nice side effect of causing more certain crashes in case of
invalid reuse of the table after (or during) destruction.
2019-05-20 16:55:45 +01:00
Allison Karlitskaya
c6137e974d ghash: Improve internal documentation
The changes introduced by 18745ff674896c931379d097b18d74678044668e made
the comment at the top of g_hash_table_remove_all_nodes() no longer
correct.  Fix that inaccuracy and add more documentation all-around.
2019-05-20 16:55:45 +01:00
Allison Karlitskaya
64f76bb173 ghash: fix bug introduced by valgrind fix
g_hash_table_new_full() had an invocation of
g_hash_table_realloc_key_or_value_array() with the @is_big argument
incorrectly hardcoded to FALSE, even though later in the function the
values of have_big_keys and have_big_values would be set conditionally.

This never caused problems before because on 64bit platforms, this would
result in the allocation of a guint-sized array (which would be fine, as
have_big_keys and have_big_values would always start out as false) and
on 32bit platforms, this function ignored the value and always allocated
a gpointer-sized array.

Since merge request GNOME/glib!845 we have the possibility for
have_big_keys and have_big_values to start out as TRUE on 64bit
platforms.  We need to make sure we pass the argument through correctly.
2019-05-20 16:55:45 +01:00
Philip Withnall
86c6f7e2b2 Merge branch 'backport-840-hash-table-valgrind-glib-2-60' into 'glib-2-60'
Backport !840 “ghash: Disable small-arrays under valgrind” to glib-2-60

See merge request GNOME/glib!844
2019-05-20 15:55:05 +00:00
Emmanuele Bassi
5e0e3607c7 Merge branch 'backport-828-meson-abaltmon-fix-glib-2-60' into 'glib-2-60'
Backport !828 “build: Fix a typo in the test whether _NL_ABALTMON_n is supported” to glib-2-60

See merge request GNOME/glib!829
2019-05-20 12:26:40 +00:00
Emmanuele Bassi
b53ad5aae2 Merge branch 'backport-845-format-size-buffer-size-glib-2-60' into 'glib-2-60'
Backport !845 “Fixing g_format_size_full() on Windows-x64” to glib-2-60

See merge request GNOME/glib!846
2019-05-20 12:16:12 +00:00
Emmanuele Bassi
a033d368d0 Merge branch 'backport-839-greek-genitive-glib-2-60' into 'glib-2-60'
Backport !839 “tests: Update month name check for Greek locale” to glib-2-60

See merge request GNOME/glib!841
2019-05-20 12:15:45 +00:00
Emmanuele Bassi
ff0fd18683 Merge branch 'backport-814-gschema-fix-glib-2-60' into 'glib-2-60'
Backport !814 “gschema.dtd: Add target attribute to alias” to glib-2-60

See merge request GNOME/glib!816
2019-05-20 12:15:13 +00:00
Philip Withnall
57997abdc1 Merge branch 'wip/tingping/network-address-backport' into 'glib-2-60'
Backport !823 "gnetworkaddress: Fix parallel enumerations interfering with eachother" to glib-2-60

See merge request GNOME/glib!834
2019-05-16 09:01:48 +00:00
Emmanuel Fleury
ba3ff8741f Fixing g_format_size_full() on Windows-x64
For some reasons, the buffer used in the Format struct was not long
enough on Windows-x64 and the final null ('\0') character was omitted
leading to a limited memory disclosure.
2019-05-15 12:28:49 +01:00
Allison Karlitskaya
75f8ec1df9 ghash: Disable small-arrays under valgrind
Valgrind can't find 64bit pointers when we pack them into an array of
32bit values.  Disable this optimisation if we detect that we are
running under valgrind.

Fixes #1749
2019-05-14 16:51:11 +01:00
Rafal Luzynski
4feeb3ec30 tests: Update month name check for Greek locale
Update the abbreviated month name in the test to match the actual
translation. Otherwise the test fails with false positive.

Vocabulary:

July (nominative)  - Greek: Ιούλιος (abbreviated: Ιούλ)
Of July (genitive) - Greek: Ιουλίου (abbreviated: Ιουλ)

This is similar to commit 4d215e006ee69bd7a993bf853722993433adbf9a
and commit 7fe793e125c316ac34edd8158df5a132cb044bc1.

Closes #1776
2019-05-14 10:53:50 +01:00
Emmanuele Bassi
6729a82b0c Merge branch 'backport-835-german-typo-glib-2-60' into 'glib-2-60'
Backport !835 “Fix typo in German translation” to glib-2-60

See merge request GNOME/glib!838
2019-05-13 15:00:08 +00:00
Martin Kröning
72817af402 Fix typo in German translation 2019-05-13 11:49:57 +01:00
Patrick Griffis
1b77792ac3 gnetworkaddress: Fix parallel enumerations interfering with eachother
The parent GNetworkAddress contains a shared list of resolved
addresses that is used as a cache for multiple enumerations.

This commit ensures that the cache is only set upon completion of
DNS lookups and only read once by enumerations to avoid being in a
bad state.

Fixes #1771
2019-05-10 18:08:48 -07:00