23948 Commits

Author SHA1 Message Date
Milo Casagrande
46737f3702 Update Italian translation 2021-11-09 08:15:31 +00:00
Sebastian Dröge
a28c93003b Merge branch 'backport-2161-delayed-settings-null-handling-glib-2-70' into 'glib-2-70'
Backport !2161 “gdelayedsettingsbackend: Fix applying after calling g_settings_reset()” to glib-2-70

See merge request GNOME/glib!2320
2021-11-04 10:52:37 +00:00
Philip Withnall
e665cc94c4 gsettings: Drop internal delayed member
This introduces no functional changes; it only simplifies the code.

Instead of maintaining a separate pointer to the backend iff it’s a
`GDelayedSettingsBackend`, just test the `backend` pointer’s type.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #2426
2021-11-04 10:21:13 +00:00
Philip Withnall
f941329b56 gsettings: Clarify that g_settings_get_child() inherits delay-apply
Previously, the delay-apply status of the parent `GSettings` object
would be partially inherited: `settings->priv->backend` in the child
`GSettings` object would point to a `GDelayedSettingsBackend`, but
`settings->priv->delayed` would be `NULL`.

The expectation from https://bugzilla.gnome.org/show_bug.cgi?id=720891
was that `get_child()` would fully inherit delay-apply status.

So, ensure that `settings->priv->delayed` is correctly set to point to
the delayed backend when constructing any `GSettings`. Update the tests
to work again (presumably the inverted test was an oversight in the
original changes).

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #2426
2021-11-04 10:21:11 +00:00
Philip Withnall
51e16afcbf gsettings: Improve documentation formatting slightly
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-11-04 10:20:35 +00:00
Philip Withnall
62a1f3b9b5 tests: Use a helper macro to drop redundant code in gsettings test
This introduces no functional changes.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-11-04 10:20:35 +00:00
Philip Withnall
21b1767af6 gdelayedsettingsbackend: Fix applying after calling g_settings_reset()
`g_settings_reset()` changes the value of the setting to `NULL`;
`add_to_tree()` was not handling that correctly.

Add a unit test.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #2426
2021-11-04 10:20:35 +00:00
Xavier Claessens
562295c286 Rename libpcre.wrap to pcre.wrap
It is exactly the same wrap as the one in WrapDB but with a different
name. That fix error when multiple projects uses pcre and they don't
have the same wrap name:

meson.build:1:0: ERROR: Multiple wrap files provide 'libpcre' dependency: pcre.wrap and libpcre.wrap
2021-11-01 18:24:26 +00:00
Philip Withnall
eaf3169a4b Merge branch 'backport-2260-win32-registry-assert-glib-2-70' into 'glib-2-70'
Backport !2260 “GWin32AppInfo: Remove assertion on the opened registry key” to glib-2-70

See merge request GNOME/glib!2313
2021-11-01 15:34:54 +00:00
Philip Withnall
0b14fd8b47 tests: Add D-Bus object/subtree unregistration tests
These tests cover the fixes from the previous two commits.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #2400
2021-11-01 14:48:19 +00:00
Philip Withnall
a427344558 gdbusconnection: Fix race between subtree method call and unregistration
Fix another variant of the previous commit, this time specific to the
idle callback of a method call on a subtree object, racing with
unregistration of that subtree.

In this case, the `process_subtree_vtable_message_in_idle_cb()` idle
callback already has a pointer to the right `ExportedSubtree` struct,
but again doesn’t have a strong reference to it.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #2400
2021-11-01 14:48:19 +00:00
Philip Withnall
5e6d000501 gdbusconnection: Fix race between method calls and object unregistration
If `g_dbus_connection_unregister_object()` (or `unregister_subtree()`)
was called from one thread, while an idle callback for a method call (or
a property get or set) was being invoked in another, it was possible for
the two to race after the idle callback had checked that the
object/subtree was registered, but before it had finished dereferencing
all the data related to that object/subtree.

Unregistering the object/subtree would immediately free the data,
leading the idle callback to cause a use-after-free error.

Fix that by giving the idle callback a strong reference to the data from
inside the locked section where it checks whether the object/subtree is
still registered.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #2400
2021-11-01 14:48:19 +00:00
Philip Withnall
309e7428b5 gdbusconnection: Make ExportedInterface/ExportedSubtree refcounted
This is needed for an upcoming change which decouples their lifecycle
from their presence in the `map_id_to_ei` and `map_id_to_es` hash
tables.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #2400
2021-11-01 14:48:19 +00:00
Philip Withnall
4348d35bd6 gdbusconnection: Add some ownership annotations
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-11-01 14:48:19 +00:00
Philip Withnall
93eefb3e22 gdbusconnection: Move ExportedSubtree definition
Move it further up the file, but make no changes to it. This will help
with a subsequent commit.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #2400
2021-11-01 14:48:19 +00:00
Luca Bacci
eb3bcf8ba0 GWin32AppInfo: Remove assertion on the opened registry key
Relax assertion about opened registry key as it may have been removed
in the meantime between enumeration and when opening, or (more likely)
we may not have the required permissions to open the some enumerated
keys (i.e. RegOpenKeyExW fails and returns ERROR_ACCESS_DENIED).

Fixes https://gitlab.com/inkscape/inbox/-/issues/5669
2021-11-01 14:33:13 +00:00
Sebastian Dröge
2aca2cfbcc Merge branch 'backport-2308-volatile-glib-2-70' into 'glib-2-70'
Backport !2308 “gthread-win32: Remove an unnecessary volatile qualifier” to glib-2-70

See merge request GNOME/glib!2314
2021-11-01 12:36:23 +00:00
Philip Withnall
66a195bb78 gthread-win32: Remove an unnecessary volatile qualifier
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-11-01 12:00:50 +00:00
Philip Withnall
2be5416a35 2.70.1
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2.70.1
2021-10-28 13:29:17 +01:00
Philip Withnall
359a837ee4 Merge branch 'fatal-meson-warnings' into 'glib-2-70'
meson: fix warnings for extract_all_objects function

See merge request GNOME/glib!2304
2021-10-21 09:35:16 +00:00
Eli Schwartz
a1a3a41bea
update the proxy-libintl subproject to the latest release
0.2 was just tagged, which includes a commit from 2018 that fixes a
meson warning which caused the project to fail to build on Windows with
--fatal-meson-warnings enabled.

(cherry picked from commit 9255f1b2a91483e0c35024f43992b72331e8a36e)
2021-10-20 15:35:24 -04:00
Eli Schwartz
397840eb18
meson: fix warnings for extract_all_objects function
The "recursive:" kwarg is available in the targeted minimum version of
meson, and is basically required if you want to not emit warnings and
maybe error with --fatal-meson-warnings.

The current default behavior is false, so explicitly opt in to that value.
None of these internal libraries use recursive objects anyway.

In commit c74d87e44038925baf37367ce124c027e225c11e we went a different
route, and upgraded the minimum meson version and dropped the TODO
workarounds in these files. But for a stable branch this is not
desirable.
2021-10-20 15:33:19 -04:00
Sebastian Dröge
7c9b1781e4 Merge branch 'backport-2293-msvc-analyser-fix-glib-2-70' into 'glib-2-70'
Backport !2293 “glib-private: Fix MSVC build with AddressSanitizer” to glib-2-70

See merge request GNOME/glib!2301
2021-10-19 06:30:41 +00:00
Sebastian Dröge
476895b85f Merge branch 'backport-2274-getpwnam-glib-2-70' into 'glib-2-70'
Backport !2274 “Do not try to access errno after calling getpwnam_r.” to glib-2-70

See merge request GNOME/glib!2276
2021-10-19 06:25:07 +00:00
Sebastian Dröge
494062b36f Merge branch 'backport-2251-string-performance-glib-2-70' into 'glib-2-70'
Backport !2251 “GString: Bump minimum size” to glib-2-70

See merge request GNOME/glib!2253
2021-10-19 06:21:55 +00:00
Sebastian Dröge
39183abe81 Merge branch 'backport-2285-svace-fixes-glib-2-70' into 'glib-2-70'
Backport !2285 “fix issues found by svace static code analyzer” to glib-2-70

See merge request GNOME/glib!2300
2021-10-19 06:21:23 +00:00
Sebastian Dröge
7513af8f07 Merge branch 'backport-2291-nm-properties-changed-glib-2-70' into 'glib-2-70'
Backport !2291 “gnetworkmonitornm: Stop using removed PropertiesChanged signal” to glib-2-70

See merge request GNOME/glib!2302
2021-10-19 06:20:54 +00:00
Julian Andres Klode
20fedaf01d gnetworkmonitornm: Do not re-update cached property
GDBusProxy already takes care of updating the cached property
before emitting the signal, so there is no need to do this
a second time ourselves.
2021-10-18 13:22:09 +01:00
Julian Andres Klode
8fc462f761 gnetworkmonitornm: Stop using removed PropertiesChanged signal
Use the org.freedesktop.DBus.Properties interface to listen
to PropertiesChanged signals on /org/freedesktop/NetworkManager.

NetworkManager used to provide its own legacy PropertiesChanged
signal, but that was dropped in
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/853

This requires NetworkManager >= 1.2 (2016)

Fixes: #2505
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1946196
2021-10-18 13:22:09 +01:00
Seungha Yang
376c9c360d glib-private: Fix MSVC build with AddressSanitizer
MSVC supports AddressSanitizer as well via "/fsanitize=address" option,
but __lsan_ignore_object() equivalent feature is not supported.
Note that there's __declspec(no_sanitize_address) specifier which
provides a similar feature but that's not runtime behavior
so it's not directly applicable to g_ignore_leak() family.

See also https://docs.microsoft.com/en-us/cpp/sanitizers/asan-building?view=msvc-160
2021-10-18 13:21:29 +01:00
Egor Bychin
2f8e17ad84 add OOM handling in mimemagic 2021-10-18 13:20:48 +01:00
Egor Bychin
c590938ba9 gtype: Fix pointer being dereferenced despite NULL check 2021-10-18 13:20:48 +01:00
Egor Bychin
3d80917578 gvariant: Fix pointers being dereferenced despite NULL checks 2021-10-18 13:20:48 +01:00
Egor Bychin
d25f5c0dfb gvariant: Fix memory leak on a TYPE_CHECK failure 2021-10-18 13:20:48 +01:00
Egor Bychin
88604931bb gslice: Fix page size being limited to int instead of gsize 2021-10-18 13:20:48 +01:00
Egor Bychin
644c9b964d gmessages: Add check for a localtime function return value 2021-10-18 13:20:48 +01:00
Egor Bychin
da1d64cb4d gkeyfile: Remove unreachable code 2021-10-18 13:20:48 +01:00
Egor Bychin
4d8c5b6d77 gbacktrace: Fix fcntl command arguments not being checked 2021-10-18 13:20:48 +01:00
Egor Bychin
f4ea12c6b4 gsocks5proxy: Fix buffer overflow on a really long domain name 2021-10-18 13:20:48 +01:00
Egor Bychin
567fae6e0b gsocket: Add ignorant of an fcntl return value 2021-10-18 13:20:48 +01:00
Egor Bychin
8d056da0bf gsettings-mapping: Fix HANDLE being treated as unsigned 2021-10-18 13:20:48 +01:00
Egor Bychin
e81c9098b0 gproxyaddressenumerator: Fix string leakage on an invalid input 2021-10-18 13:20:48 +01:00
Egor Bychin
b293fc5376 gopenuriportal: Fix GVariantBuilder and string leakage on g_open failure 2021-10-18 13:20:48 +01:00
Egor Bychin
5eb4e095c7 gmarshal-internal: Fix string leakage due to misplaced check 2021-10-18 13:20:48 +01:00
Egor Bychin
55dea0fd8d glocalfileinfo: Fix atime/mtime mix due to bad copy/paste 2021-10-18 13:20:48 +01:00
Egor Bychin
7b582a9993 glocalfile: Fix g_stat return value not being checked 2021-10-18 13:20:48 +01:00
Egor Bychin
5796babc5c gdbusauthmechanismsha1: Fix pointer being freed after being NULLed 2021-10-18 13:20:48 +01:00
Gleb Popov
881b4c215f Do not try to access errno after calling getpwnam_r. 2021-09-28 11:40:37 +01:00
Emmanuele Bassi
25009189d1 Merge branch 'backport-2266-fix-uninit-variable-glib-2-70' into 'glib-2-70'
Backport !2266 “fix uninitial variable” to glib-2-70

See merge request GNOME/glib!2271
2021-09-27 14:01:34 +00:00
liuyangming
8d884c21bf fix uninitial variable 2021-09-27 14:40:18 +01:00